1.0.0-alpha.0 • Published 7 years ago
@euclid/clamp v1.0.0-alpha.0
@euclid/clamp
Constrain a value to lie between two further values
$ npm install @euclid/clampExample
let v = clamp(11, 0, 10);
//=> 10API
Clamps the number n between min (inclusive) and max (inclusive).
clamp(n, min, max)
Returns: Number
Number clamped in range min and max.
n
Type: Number
Value to clamp.
min
Type: Number
Lower end of the range into which to constrain n.
max
Type: Number
Upper end of the range into which to constrain n.
1.0.0-alpha.0
7 years ago