bearophile wrote:
Steven Schveighoffer:

If I have 2 identical floating point values, how do I ensure they are binary equivalents of eachother?

Try this inside std.math of Phobos2:
bool isIdentical(real x, real y);


I thought 'a is b' would work, but it just morphs into a == b, which isn't helpful. Why doesn't 'is' just do a bit compare for floating points?

"is" is used to compare references.

No. If you use it with structs, the type's opEquals is not called. "is" is used for a lot of things.

I agree that is should do a bitwise comparison for floating points. That would be a nice fix for D2.

Bye,
bearophile

Reply via email to