time-to-botec

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

repl.txt (1485B)


      1 
      2 {{alias}}( [out,] x )
      3     Splits a double-precision floating-point number into a normalized fraction
      4     and an integer power of two.
      5 
      6     The first element of the returned array is the normalized fraction and the
      7     second is the exponent. The normalized fraction and exponent satisfy the
      8     relation
      9 
     10       x = frac * 2^exp
     11 
     12     If provided positive or negative zero, `NaN`, or positive or negative
     13     infinity, the function returns a two-element array containing the input
     14     value and an exponent equal to zero.
     15 
     16     For all other numeric input values, the absolute value of the normalized
     17     fraction resides on the interval [0.5,1).
     18 
     19     Parameters
     20     ----------
     21     out: Array|TypedArray|Object (optional)
     22         Output array.
     23 
     24     x: number
     25         Input value.
     26 
     27     Returns
     28     -------
     29     out: Array|TypedArray|Object
     30         A normalized fraction and an exponent.
     31 
     32     Examples
     33     --------
     34     > var out = {{alias}}( 4.0 )
     35     [ 0.5, 3 ]
     36     > out = {{alias}}( 0.0 )
     37     [ 0.0, 0 ]
     38     > out = {{alias}}( -0.0 )
     39     [ -0.0, 0 ]
     40     > out = {{alias}}( NaN )
     41     [ NaN, 0 ]
     42     > out = {{alias}}( {{alias:@stdlib/constants/float64/pinf}} )
     43     [ Infinity, 0 ]
     44     > out = {{alias}}( {{alias:@stdlib/constants/float64/ninf}} )
     45     [ -Infinity, 0 ]
     46 
     47     // Provide an output array:
     48     > out = new {{alias:@stdlib/array/float64}}( 2 );
     49     > var y = {{alias}}( out, 4.0 )
     50     <Float64Array>[ 0.5, 3 ]
     51     > var bool = ( y === out )
     52     true
     53 
     54     See Also
     55     --------
     56