clamp
Public function
Clamp a value into a range.
Example
const A = clamp(0, 1) // 1
Signature
function clamp(n: number, min: number): number
Parameters
Name | Description |
---|---|
|
The number to clamp. |
|
The minimum value. |
Returns
number
Source
Public function
Clamp a value into a range.
const A = clamp(0, 1) // 1
function clamp(n: number, min: number): number
Name | Description |
---|---|
|
The number to clamp. |
|
The minimum value. |
number