Core Function Wrap
From Sputnik Wiki
Clamp( <value>, <min>, <max> )
Contents |
Description
Clamps the specified value.
Parameters
value
Number to check.
min
The min.
max
The max.
Return Value
Result of the wrapping.
Remarks
If any of the 3 values are a floating point then the Wrap() will compare as a floating point otherwise it will compare as an integer.
Example
say Wrap(4, 5, 20); // 19 say Wrap(5, 5, 20); // 5 say Wrap(6, 5, 20); // 6 say Wrap(18, 5, 20); // 18 say Wrap(20, 5, 20); // 20 say Wrap(21, 5, 20); // 6 say Wrap(22, 5, 20); // 7