base
exponent
function value
var y = powm1( 2.0, 3.0 );
// returns 7.0
var y = powm1( 4.0, 0.5 );
// returns 1.0
var y = powm1( 0.0, 100.0 );
// returns -1.0
var y = powm1( 100.0, 0.0 );
// returns 0.0
var y = powm1( 0.0, 0.0 );
// returns 0.0
var y = powm1( 3.141592653589793, 5.0 );
// returns ~305.0197
var y = powm1( NaN, 3.0 );
// returns NaN
var y = powm1( 5.0, NaN );
// returns NaN
Evaluates
bˣ - 1
.Notes
b
is close to1
and/orx
is small, this function is more accurate than naively computingbˣ
and subtracting1
.