Re:1/0 = 0 (2018)
by v4vvdq on Sunday December 01, 2024 @03:57PM
(#42290678)
Then take 10 and divide it by -10 = -1. 10 / -5 = -2. 10 / -0.5 = -20.
So from the other side of the y-axis it behaves the exact opposite. It goes to minus infinity. So at x=0 we would have infinity and minus infinity at the same time. Imho that is why it is undefined.
[ Parent
| on HN ]
Re:1/0 = 0 (2018)
by WithinReason on Sunday December 01, 2024 @03:59PM
(#42290693)
on computers you can have negative zeros
Negative zero is equal to zero, so it's not really a distinct number, just another representation of the same value.
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:
> 1 / 0
Infinity
> 1 / -0
-Infinity
> 0 === -0
true
> Object.is(0, -0)
falseYes.
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.
-0 is a notation for 1 / -infinity, so it is distinct. For addition it is not.
Re:1/0 = 0 (2018)
by pasquinelli on Monday December 02, 2024 @12:11AM
(#42293317)
that's really just an encoding of the number to help you understand how the hell you got here
In IEEE 754 math, x/0 for x < 0 is in fact negative infinity.
>>> 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.I always thought the answer to verbal query "let y=1/x, x=0, find y" was "Well, the answer is the Y axis of the plot". Surprising that people have to be reminded that X can be signed. I've had similar conversation IRL.
Re:1/0 = 0 (2018)
by ConspiracyFact on Monday December 02, 2024 @04:46PM
(#42300777)
You seem to have your axes confused. The value of y can’t be “the y-axis”, which is the line x = 0 (for all values of y).