std.math.isIdentical and NaN

Dan Olson via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 22 01:10:20 PDT 2015


Docs for isIdentical say:

   Same as ==, except that positive and negative zero are not identical,
   and two NANs are identical if they have the same 'payload'.

However, it returns false for NaN's with different signbits but same
payload.  Should this be the case?

Ran into this because isIdentical is used in unittests to compare NaN's
but I find an occassional test fails due to signbit for some operations
on LDC ARM.  I wrote an isNaNWithPayload() predicate for the failing
tests, but wonder if isIdentical should ignore signbit for NaNs or have
its docs changed.
-- 
Dan


More information about the Digitalmars-d mailing list