nn::math::Clamp Function
template <typename T>
T Clamp(
T x,
T low,
T high
);
| Name | Description |
|---|---|
| T | Type representing a numerical value. |
| Name | Description | |
|---|---|---|
| in | x | Value to operate on. |
| in | low | Low threshold value. |
| in | high | High threshold value. |
Clamps a value to the specified range.
If x is not between low and high, this function returns the value (either low or high) that is closer to x.
CONFIDENTIAL