1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
{{alias}}( v, min, max )
Restricts a double-precision floating-point number to a specified range.
If provided `NaN` for any argument, the function returns `NaN`.
Parameters
----------
v: number
Value to restrict.
min: number
Minimum value.
max: number
Maximum value.
Returns
-------
y: number
Restricted value.
Examples
--------
> var y = {{alias}}( 3.14, 0.0, 5.0 )
3.14
> y = {{alias}}( -3.14, 0.0, 5.0 )
0.0
> y = {{alias}}( 3.14, 0.0, 3.0 )
3.0
> y = {{alias}}( -0.0, 0.0, 5.0 )
0.0
> y = {{alias}}( 0.0, -3.14, -0.0 )
-0.0
> y = {{alias}}( NaN, 0.0, 5.0 )
NaN
See Also
--------
|