Limit to interval — clamp (math_constrain)¶
What it does: Limits the value of X to the range [LOW, HIGH].

Inputs¶
- VALUE: input value.
- LOW, HIGH: limits.
Output¶
- number
Tips¶
- Verify that LOW ≤ HIGH (otherwise the generated code may throw boundaries).
- The generated expression is
min(max(VALUE, LOW), HIGH); atLOW > HIGHthe result does not match the normal interval.