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