November 5th, 2007

Away from the weasel appeasing pheromones

I am bugged by the negative zeros. A quick test with VC 2003 shows that 0.0 * -1000.0 is -0.0 there too, but the negative zeros are hushed up more effectively because both the debugger and formatting display them as positive zeros.
I assume that one some level this is 'correct' since both our fine C++ and Fortran compilers do it. However, on another level, it is clearly 'wrong'. I am pretty sure I was never told 'you know the way 0 acts as an identity for multiplication? Well, one of the many screwy things about floating point maths is that it doesn't work that way, but we hush up the negative zeros'.