Re:1/0 = 0 (2018)
by epidemian on Sunday December 01, 2024 @10:32PM
(#42292844)
It's equal (as in, comparing them with == is true), but they are not the same value. At least in IEEE 754 floats, which is what most languages with floating point numbers use. E.g., in JS:
[ Parent
| on HN ]
Yes.
In a language like C or Rust, you can cast your +0.0 and -0.0 to an integer, and print out the bit pattern. They are different.
I think you're misunderstanding me. They are the same value, but a different representation. The equivalence of the value can be shown with math, and has nothing to do with the implementation details of IEEE 754.