wrap(value, min, max) → {number}
Ensures that the value always stays between min and max, by wrapping the value around.
If max
is not larger than min
the result is 0.
Parameters
Name | Type | Description |
---|---|---|
value | number | The value to wrap. |
min | number | The minimum the value is allowed to be. |
max | number | The maximum the value is allowed to be, should be larger than |
Returns
number -
The wrapped value.
- Source code: math/Math.js (Line 521)
Please login to continue.