by v4vvdq · 2y ago · 0 comments
>>> np.float64(-1.)/0.
-inf
>>> np.float64(1.)/0.
inf
And you're exactly right, 0/0 is NaN in 754 math exactly because it approaches negative infinity, zero (from 0/x), and positive infinity at the same time. > 1 / 0
Infinity
> 1 / -0
-Infinity
> 0 === -0
true
> Object.is(0, -0)
falseIn 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.