Home > rc-js-util > mathBound
Bound a value in to a range.
Signature:
export declare function mathBound(value: number, min: number, max: number): number;
| Parameter | Type | Description |
|---|---|---|
| value | number | |
| min | number | |
| max | number |
Returns:
number
The value if it lies between min and max, otherwise min if smaller and max if greater.
NaN input will cause a debug error.
See mathBound().