Very strange problem with comparing floating point numbers

jerro a at a.com
Sun Sep 30 13:48:03 PDT 2012


> I don't really agree with that. floating point operations are 
> just inexact, regardless of optimizations. That's how they 
> work, period.

It is true that they are inexact, but inexact and 
non-deterministic are not the same thing. Floating point 
operations are deterministic. Doing the same operation twice on 
the same machine with the same rounding mode and parameters will 
give you the same result. This should also be true when you do 
those operations using D, and using == on the two results should 
return true.



More information about the Digitalmars-d-learn mailing list