[Issue 7836] NaNs inside associative array don't use normal FP equality
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jul 8 19:57:28 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7836
hsteoh at quickfur.ath.cx changed:
What |Removed |Added
----------------------------------------------------------------------------
OS/Version|Windows |All
--- Comment #2 from hsteoh at quickfur.ath.cx 2013-07-08 19:57:27 PDT ---
Actually, this bug has nothing to do with AA's. The problem is that double's
typeinfo.equals and typeinfo.compare does not respect NaNs:
import std.stdio: writeln;
void main() {
double x = double.nan, y = double.nan;
writeln(x == y); // prints false (OK)
writeln(typeid(double).equals(&x, &y)); // prints true (WRONG)
writeln(typeid(double).compare(&x, &y)); // prints 0 (WRONG)
}
--
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