repl.txt (840B)
1 2 {{alias}}( v, min, max ) 3 Wraps a value on the half-open interval `[min,max)`. 4 5 The function does not distinguish between positive and negative zero. Where 6 appropriate, the function returns positive zero. 7 8 If provided `NaN` for any argument, the function returns `NaN`. 9 10 Parameters 11 ---------- 12 v: number 13 Value to wrap. 14 15 min: number 16 Minimum value. 17 18 max: number 19 Maximum value. 20 21 Returns 22 ------- 23 y: number 24 Wrapped value. 25 26 Examples 27 -------- 28 > var y = {{alias}}( 3.14, 0.0, 5.0 ) 29 3.14 30 > y = {{alias}}( -3.14, 0.0, 5.0 ) 31 ~1.86 32 > y = {{alias}}( 3.14, 0.0, 3.0 ) 33 ~0.14 34 > y = {{alias}}( -0.0, 0.0, 5.0 ) 35 0.0 36 > y = {{alias}}( 0.0, -3.14, -0.0 ) 37 -3.14 38 > y = {{alias}}( NaN, 0.0, 5.0 ) 39 NaN 40 41 See Also 42 -------- 43