math-clamp-x
Clamp a number to limits.
Version: 1.2.0
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750
module.exports(value, [min], max) ⇒ number ⏏
This method clamp a number to min and max limits inclusive.
Kind: Exported function
Returns: number - The clamped number.
Throws:
RangeErrorIf min > max.
| Param | Type | Default | Description |
|---|---|---|---|
| value | number |
The number to be clamped. | |
| [min] | number |
0 |
The minimum number. |
| max | number |
The maximum number. |
Example
var mathClamp = require('math-clamp-x');