Re:In Erlang/OTP 27, +0.0 will no longer be exactly equal to...
by moonchild on Tuesday May 09, 2023 @10:16PM
(#35882856)
> 0 and -0 being distinct values is honestly just an accident of convenience with how floats are stored
That's not at all true. The inclusion of negative zero in ieee 754 was a deliberate design choice, and if it were considered desirable that zero should be unsigned, then the bit pattern assigned to -0 would not have been so designed. See 'much ado about nothing's sign bit'[0], by one of the principal authors of ieee 754.
Whereas -0 and +0 are not operationally equivalent, operational equivalence is an important and useful relation; see the very pattern matching example linked from the OP[1].
That's not at all true. The inclusion of negative zero in ieee 754 was a deliberate design choice, and if it were considered desirable that zero should be unsigned, then the bit pattern assigned to -0 would not have been so designed. See 'much ado about nothing's sign bit'[0], by one of the principal authors of ieee 754.
Whereas -0 and +0 are not operationally equivalent, operational equivalence is an important and useful relation; see the very pattern matching example linked from the OP[1].
0. https://people.freebsd.org/~das/kahan86branch.pdf
1. https://erlangforums.com/t/total-term-order/2477/41