repl.txt (1147B)
1 2 {{alias}}( [out,] x ) 3 Decomposes a double-precision floating-point number into integral and 4 fractional parts, each having the same type and sign as the input value. 5 6 Parameters 7 ---------- 8 out: Array|TypedArray|Object (optional) 9 Output array. 10 11 x: number 12 Input value. 13 14 Returns 15 ------- 16 parts: Array|TypedArray|Object 17 Integral and fractional parts. 18 19 Examples 20 -------- 21 > var parts = {{alias}}( 3.14 ) 22 [ 3.0, 0.14000000000000012 ] 23 > parts = {{alias}}( 3.14 ) 24 [ 3.0, 0.14000000000000012 ] 25 > parts = {{alias}}( +0.0 ) 26 [ +0.0, +0.0 ] 27 > parts = {{alias}}( -0.0 ) 28 [ -0.0, -0.0 ] 29 > parts = {{alias}}( {{alias:@stdlib/constants/float64/pinf}} ) 30 [ Infinity, +0.0 ] 31 > parts = {{alias}}( {{alias:@stdlib/constants/float64/ninf}} ) 32 [ -Infinity, -0.0 ] 33 > parts = {{alias}}( NaN ) 34 [ NaN, NaN ] 35 36 // Provide an output array: 37 > var out = new {{alias:@stdlib/array/float64}}( 2 ); 38 > parts = {{alias}}( out, 3.14 ) 39 <Float64Array>[ 3.0, 0.14000000000000012 ] 40 > var bool = ( parts === out ) 41 true 42 43 See Also 44 -------- 45