Comment #3 on issue 1101 by [email protected]: NaN is converted to
0xfff8000000000000 (-NaN)
http://code.google.com/p/v8/issues/detail?id=1101
Understood.
The original WebKit bug is https://bugs.webkit.org/show_bug.cgi?id=53598 .
It seems the specification of this behavior comes from the Web IDL spec at
http://dev.w3.org/2006/webapi/WebIDL/ , specifically sections 4.1.11 and
4.1.12 (float and double), where the bit pattern for NaN values is
specified.
The submitter of the above WebKit bug points out that we could consider
changing the Typed Array spec to admit additional NaN representations. I'm
inclined to do this because if high-performance JavaScript engines like V8
want to avoid canonicalizing the NaN representation internally (for
whatever reason) then the Typed Array spec should allow for the maximum
performance to be achieved.
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev