[Issue 3632] modify float is float to do a bitwise compare

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 28 02:23:30 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=3632



--- Comment #15 from Walter Bright <bugzilla at digitalmars.com> 2011-06-28 02:17:47 PDT ---
(In reply to comment #14)
> I use it all the time, mainly for distinguishing between +0.0 and -0.0

'is' does distinguish between +0 and -0. Just not -Nan and +Nan, nor the Nan
payloads.

> But it's reasonable to argue that '+0.0 is -0.0' should return true, and if you
> do that, then 'NaN is NaN' should also return true, regardless of the payload.

I believe those are entirely different situations. The sign of 0 has a
mathematical meaning to fp arithmetic, the sign/payload of Nan does not.

> NaN payloads were used extensively in Apple's SANE, to distinguish different
> error types. Eg,
> http://doc.4d.com/4D-Language-Reference-11.6/Error-Codes/SANE-NaN-Errors-1-255.300-206143.en.html

I didn't know that. But it's worth noting that SANE has been dropped.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list