satadd - saturated addition
val1.satadd(val2, min,
max)
The satadd() method performs saturated
addition 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 addition, 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->satadd(50, 0, 120)
120
100->satadd(-200, 0, 120)
0
a = [10, 20, 30]
a.satadd(50, 0, 70)
60 70 70