output array
input value
output array
var Float64Array = require( `@stdlib/array/float64` );
var out = new Float64Array( 2 );
var y = frexp( out, 4.0 );
// returns <Float64Array>[ 0.5, 3 ]
var bool = ( y === out );
// returns true
Splits a double-precision floating-point number into a normalized fraction and an integer power of two.
x = frac * 2^exp
.NaN
, or positive or negative infinity, the function returns a two-element array containing the input value and an exponent equal to zero.input value
output array
var out = frexp( 4.0 );
// returns [ 0.5, 3 ]
var out = frexp( 0.0 );
// returns [ 0.0, 0 ]
var out = frexp( -0.0 );
// returns [ -0.0, 0 ]
var out = frexp( NaN );
// returns [ NaN, 0 ]
var out = frexp( Infinity );
// returns [ Infinity , 0 ]
var out = frexp( -Infinity );
// returns [ -Infinity , 0 ]
Splits a double-precision floating-point number into a normalized fraction and an integer power of two.
Notes
x = frac * 2^exp
.NaN
, or positive or negative infinity, the function returns a two-element array containing the input value and an exponent equal to zero.