Sunday, 15 July 2012

Why Math.pow(1, NaN) equals NaN in JavaScript? -



Why Math.pow(1, NaN) equals NaN in JavaScript? -

in ieee 754-2008 section "9.2.1 special values" there mentioned that

pow(+1, y) 1 y (even quiet nan)

for not reading entire document wikipedia gives shortcut:

the 2008 version of ieee 754 standard says pow(1, qnan) , pow(qnan, 0) should both homecoming 1 since homecoming 1 whatever else used instead of quiet nan.

why math.pow(1, nan) nan in javascript? doesn't follow standards?

it's because the ecmascript specification seems so.

pow (x, y)

returns implementation-dependent approximation result of raising x powerfulness y.

if y nan, result nan. ... other constraints...

javascript

No comments:

Post a Comment