Quote Originally Posted by Thantos
Thanks everyone. I was pretty sure I was correct but I just wanted to make sure



Well my number is really a class and it is written in such a way that negative zero can not exist (at the end of every math function it calls a validate function that ensures this and a couple other things)

Thanks again

Of course, the two's complement number system used in most computers does not have a representation for negative zero. My point is that sometimes you can print a floating point number which appears to be negative zero (but that's only because you didn't print enough significant digits).

In any comparison with doubles or floats you must be aware of the possibility of roundoff error, even though the numbers are "rational" in base 10.

My example shows on my computers that 0.1 + 0.1 may not give the same answer as 1.0 - 0.8

Regards,

Dave