Re: Observability of NaN distinctions — is this a concern?
dherman at mozilla.com
Fri Mar 22 22:44:30 PDT 2013
On Mar 20, 2013, at 2:47 PM, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
> Here is the exact language that is in the current ES6 draft for storing a Number into a buffer as a Float64 (rawValue is the value that gets stored into the buffer):
> Set rawValue to the 8 bytes that are the IEEE-868-2005 binary64 format encoding of value. If isBigEndian is true, the bytes are arranged in big endian order. Otherwise, the bytes are arranged in little endian order. If value is NaN, rawValue is may be set to any implementation choosen non-signaling NaN encoding.
This is what Ken is saying he prefers (for performance), but it violates the stated language invariant of section 8.1.5.
Notice that it's exactly the language "rawValue is may (sic) be set to any implementation choosen (sic) non-signaling NaN encoding" that is non-deterministic. It doesn't actually say what bit pattern is produced, and the program may subsequently observe which bit pattern it was. That's what breaks the invariant.
More information about the es-discuss