Math functions.
| Namespace: | dmMath |
| Include: | #include <dmsdk/dlib/math.h> |
| FUNCTIONS | |
|---|---|
| template <T> T Abs (T x) | Abs function |
| template <T> T Clamp (T v, T min, T max) | Clamp function |
| template <T> T Max (T a, T b) | Max function |
| template <T> T Min (T a, T b) | Min function |
| template <T> T Select (T x, T a, T b) | Select one of two values |
T Clamp(T v, T min, T max)
Clamp function
PARAMETERS
T |
v |
Value to clamp |
T |
min |
Lower bound |
T |
max |
Upper bound |
RETURNS
T |
Value closest to v inside the range [min, max] |