Is the sum of a float and its negation guaranteed to be zero?

Viewed 65

Using standard IEEE floating point, is a + -a guaranteed to be exactly 0 for any value of a?

I'd imagine a and -a have the exact same bit representation, minus the sign bit, so adding them together is guaranteed to result in 0 but I'm not sure.

1 Answers
Related