Re: Observability of NaN distinctions — is this a concern?

Kenneth Russell kbr at
Mon Mar 25 14:44:34 PDT 2013

On Mon, Mar 25, 2013 at 2:40 PM, Brendan Eich <brendan at> wrote:
> Kenneth Russell wrote:
>>> >  For interop, JS requires cross-browser (VM) NaN canonicalization to
>>> > avoid
>>> >  observably different results on different browsers.
>> As long as NaN values loaded from Float32Array and Float64Array obey
>> ES6's semantics, such as returning true from isNaN(), then it should
>> not matter whether the ES6 implementation happens to support multiple
>> bit patterns for NaN.
> That's at issue. By reading via an aliasing byte or wider integral-typed
> array view, different results could be observed on two VMs for the exact
> same code.
>> NaNs are an error condition and corner case in
>> floating-point algorithms, and it is important not to negatively
>> impact the performance of the common case in order to achieve
>> absolutely precise semantics for this error case.
> I want "as close to the metal as safety and interop allow" performance. I'm
> not sure we are actually in conflict here, given how aggressive JITs work.
> Have you measured the performance impact in any optimizing VM?

No. I won't have time to do so myself, but would be interested in
working with anybody who does to measure the performance difference.


> /be

More information about the es-discuss mailing list