RFC: std.json sucessor

via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 28 08:16:30 PDT 2014


On Thursday, 28 August 2014 at 14:43:30 UTC, Don wrote:
> No. Once you load an SNAN, it isn't an SNAN any more! It is a 
> QNAN.

By which definition?  It is only if you consume the SNAN with an 
fp-exception-free arithmetic op that it should be turned into a 
QNAN. If you compute with an op that throws then it should throw 
an exception.

MOV should not be viewed as a computation…

It also makes sense to save SNAN to file when converting 
corrupted data-files. SNAN could then mean "corrupted" and QNAN 
could mean "absent". You should not get an exception for loading 
a file. You should get an exception if you start computing on the 
SNAN in the file.

> You cannot have an SNAN in a floating-point register (unless 
> you do a nasty hack to pass it in). It gets converted during 
> loading.

I don't understand this position. If you cannot load SNAN then 
why does SSE handle SNAN in arithmetic ops and compares?

> const float x = snan;
> x = x;
>
> // x is now a qnan.

I disagree (and why const?)

Assignment does nothing, it should not consume the SNAN. 
Assignment is just "naming". It is not "computing".



More information about the Digitalmars-d mailing list