Why is +0.0> -0.0 not supported for IEEE754 floats?

IEEE754 floating point numbers have a signed zero concept , i.e. There are two different bit patterns for -0.0and +0.0, which can be understood as one-sided limits: Β± 0: = lim Ξ΄ β†’ 0 Β± Ξ΄. The standard provides these numbers for consistency with (signed) infinities +Infand -Inf( 1./Β±0.gives Β±Inf), and there is some evidence that this helps reduce rounding errors.

It can be seen from the limit that while they are different entities, they are compared with the same value, i.e. +0.0 == -0.0. However, with a limit, I would also think that the following should be +0.0 > -0.0true : since it holds for any small Ξ΄. This, however, is not true. Since this property is sometimes useful (think about distinguishing between two zeros, for example), is there any good reason why the standards committee decided not to do this?

+4
source share
1 answer

Mathworld article on the number system underlying arithmetic floating point numbers by the famous newspaper David Goldberg , which states:

+0 -0 , . , x = y ⇔ 1/x = 1/y, , x = +0 y = -0. IEEE , .

-, search , , .

. , , , , {, , , ). -0 < +0 -0 = +0 ( ) . , .

+2

Source: https://habr.com/ru/post/1668297/


All Articles