satsub - saturated subtraction
val1.satsub(val2, min,
max)
The satsub() method performs saturated
subtraction of val1 and val2 within the range
[min, max]. The result is equivalent to (val1
- val2).clamp(min, max).
If any argument is an array, the operation is performed element-wise. All arguments must be numeric.
The result of the saturated subtraction, clamped to the range [min, max].
TypeCheck if any argument is not numeric
ArgCheck if an incorrect number of arguments
is given
RangeCheck if min is
greater than max
100->satsub(50, 0, 120)
50
100->satsub(200, 0, 120)
0
a = [70, 20, 30]
a.satsub(50, 0, 70)
20 0 0