time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (1246B)


      1 
      2 {{alias}}( [out,] x )
      3     Returns a normal number and exponent satisfying `x = y * 2^exp` as an array.
      4 
      5     The first element of the returned array corresponds to `y` and the second to
      6     `exp`.
      7 
      8     Parameters
      9     ----------
     10     out: Array|TypedArray|Object (optional)
     11         Output array.
     12 
     13     x: number
     14         Double-precision floating-point number.
     15 
     16     Returns
     17     -------
     18     out: Array|TypedArray|Object
     19         An array containing `y` and `exp`.
     20 
     21     Examples
     22     --------
     23     > var out = {{alias}}( 3.14e-319 )
     24     [ 1.4141234400356668e-303, -52 ]
     25     > var y = out[ 0 ];
     26     > var exponent = out[ 1 ];
     27     > var bool = ( y*{{alias:@stdlib/math/base/special/pow}}(2.0, exponent) === 3.14e-319 )
     28     true
     29 
     30     // Special cases:
     31     > out = {{alias}}( 0.0 )
     32     [ 0.0, 0 ];
     33     > out = {{alias}}( {{alias:@stdlib/constants/float64/pinf}} )
     34     [ Infinity, 0 ]
     35     > out = {{alias}}( {{alias:@stdlib/constants/float64/ninf}} )
     36     [ -Infinity, 0 ]
     37     > out = {{alias}}( NaN )
     38     [ NaN, 0 ]
     39 
     40     // Provide an output array:
     41     > out = new {{alias:@stdlib/array/float64}}( 2 );
     42     > var v = {{alias}}( out, 3.14e-319 )
     43     <Float64Array>[ 1.4141234400356668e-303, -52 ]
     44     > bool = ( v === out )
     45     true
     46 
     47     See Also
     48     --------
     49