News for hackers. Stuff that matters.
Re:1/0 = 0 (2018) by CharlieDigital on Sunday December 01, 2024 @03:52PM (#42290655)
There's a great Radiolab episode[0] that talks about divide by zero in perhaps more conceptual terms.

    KARIM ANI: If you take 10 and divide it by 10, you get one. 10 divided by five is two. 10 divided by half is 20. The smaller the number on the bottom, the number that you're dividing by, the larger the result. And so by that reasoning ...
    
    LULU: If you divide by zero, the smallest nothingness number we can conceive of, then your answer ...
    
    KARIM ANI: Would be infinity.
    
    LULU: Why isn't it infinity? Infinity feels like a great answer.
    
    KARIM ANI: Because infinity in mathematics isn't actually a number, it's a direction. It's a direction that we can move towards, but it isn't a destination that we can get to. And the reason is because if you allow for infinity then you get really weird results.  For instance, infinity plus zero is ...
    
    LATIF: Infinity.
    
    KARIM ANI: Infinity plus two is infinity. Infinity plus three is infinity. And what that would suggest is zero is equal to one, is equal to two, is equal to three, is equal to four ...
    
    STEVE STROGATZ: And that would break math as we know it.  Because then, as your friend says, all numbers would become the same number.
[0] https://radiolab.org/podcast/zeroworld
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.
Re:1/0 = 0 (2018) by WithinReason on Sunday December 01, 2024 @03:59PM (#42290693)
on computers you can have negative zeros
Re:1/0 = 0 (2018) by recursive on Sunday December 01, 2024 @04:11PM (#42290757)
Negative zero is equal to zero, so it's not really a distinct number, just another representation of the same value.
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:

  > 1 / 0
  Infinity
  > 1 / -0
  -Infinity
  > 0 === -0
  true
  > Object.is(0, -0)
  false
Re:1/0 = 0 (2018) by eru on Monday December 02, 2024 @06:36AM (#42295194)
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.

Re:1/0 = 0 (2018) by recursive on Monday December 02, 2024 @11:43AM (#42297881)
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.
Re:1/0 = 0 (2018) by atsmyles on Monday December 02, 2024 @09:11PM (#42302402)
-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
Re:1/0 = 0 (2018) by eqvinox on Sunday December 01, 2024 @11:01PM (#42292988)
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.
Re:1/0 = 0 (2018) by numpad0 on Monday December 02, 2024 @02:40AM (#42293959)
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).
Re:1/0 = 0 (2018) by SAI_Peregrinus on Sunday December 01, 2024 @04:03PM (#42290714)
It's even worse than that. The other issue is what happens when you've got a negative number as the numerator (number on top). Then the smaller the denominator (number on bottom) the more negative the result. -10/10 = -1. -10/5 = -2. -10/2 = -20. So if you divide by zero, it's obviously negative infinity! And it's positive infinity! At the same time.
Re:1/0 = 0 (2018) by tbrownaw on Sunday December 01, 2024 @04:42PM (#42290935)
Ordinal and cardinal infinities are different. There are hierarchies of infinities.

`1/0` and `1/0 + 1` aren't meaningfully different, so it kinda does make sense for whatever notation to not make a distinction.

Re:1/0 = 0 (2018) by feoren on Tuesday December 03, 2024 @04:36PM (#42311799)
There's no real problem here. Infinity - Infinity is not 0; it's probably best to simply call it Infinity as well.

[ok] 1. Infinity + 1 == Infinity + 2

[ok] 2. Infinity + 1 - Infinity == Infinity + 2 - Infinity

[wrong] 3a. 1 == 2 (assumes Infinity - Infinity == 0, which is false)

[ok] 3b. Infinity == Infinity

So starting from Infinity + 1 == Infinity + 2 gets you nowhere interesting.

And that quote is a great example of what I hate about every pop-sci treatment of mathematics:

> Because infinity in mathematics isn't actually a number, it's a direction

Any time someone says "actually, in mathematics, ..." they're talking out of their ass. No matter what comes after, there is a different system of math that makes their statement false. There are plenty of branches of mathematics that are perfectly happy with infinity being a "number", not a "direction". What even is a "number" anyway?