Status: New
Owner: ----

New issue 1088 by [email protected]: Math.pow(-0, 0.5) should be +0, not -0
http://code.google.com/p/v8/issues/detail?id=1088

For this snippet:
--
alert(Infinity / Math.pow(-0, 0.5));
--
I get these results:

Chrome: -Infinity
FF4: Infinity
Safari 5: Infinity
Opera 11: Infinity

It looks like V8 tries to optimize pow(x, 0.5) to sqrt(x), but this does not hold if x is -0.

From ES5 15.8.2.13:
- If x is -0 and y>0 and y is not an odd integer, the result is +0.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to