Re: Observability of NaN distinctions — is this a concern?
allen at wirfs-brock.com
Wed Mar 20 13:57:40 PDT 2013
On Mar 20, 2013, at 1:42 PM, Kevin Reid wrote:
> That normalization on read is is my case 1 above — it is necessary _for that implementation_. A conformant implementation could use a different strategy which does not normalize on Float64 read, and this would be unobservable, so the spec should not bother to specify it.
> However, lack of normalization on Float64 write _is_ potentially observable (if the implementation does not normalize all NaNs from all sources). Therefore, I argue, the spec should specify that normalization happens on write; and it happens that an implementation can omit that as an explicit step, with no observable difference, if and only if its representation of NaN in JS values (from all possible sources, not just typed arrays) is normalized.
The buffer contents may have come form an external source or the buffer may be accessible for writes by an agent that is not part of the ES implementation. The only thing that the ES implementation has absolute control over are its own reads from a buffer and the values it propagates from those reads.
More information about the es-discuss