Comparing floating point: == vs is

Daniel Murphy yebblies at nospamgmail.com
Sat Jul 16 02:23:12 PDT 2011


"Jonathan M Davis" <jmdavisProg at gmx.com> wrote in message 
news:mailman.1689.1310808023.14074.digitalmars-d-learn at puremagic.com...
> Hmm. Good to know. But assuming that two floating point values have the 
> same
> bit pattern, shouldn't == return true for them? So, if == is failing, then 
> two
> floating point values aren't identical, correct?
>
> - Jonathan M Davis

Unless one or both of the values are nans, yes.  If I had to guess I'd say 
you've been swapping the padding bytes too. 




More information about the Digitalmars-d-learn mailing list