News for hackers. Stuff that matters.
Re:You can't divide by zero – Garrit's Notes by noam_k on Saturday December 02, 2023 @11:09PM (#38504760)
> 1/0 = 0 is a totally sensible convention

Except that for all other numbers we have 1/x * x = 1, while 0*0 = 0. Defining division by zero this way breaks existing rules.

Re:You can't divide by zero – Garrit's Notes by tikhonj on Saturday December 02, 2023 @11:10PM (#38504764)
0 is always going to be a special case for division in real numbers. But how we handle that special case is a matter of convention.
Re:You can't divide by zero – Garrit's Notes by sarchertech on Saturday December 02, 2023 @11:42PM (#38504889)
Of course it’s a matter of convention. But it’s a convention without which the rest of mathematics taught to school children throughout the world falls apart.

Calling the color of the sky blue is just a matter of convention as well, but if one random teacher starts calling it green, she’s doing a terrible disservice to her students. It doesn’t matter that there exists some languages without a difference between blue and green.

Re:You can't divide by zero – Garrit's Notes by kazinator on Sunday December 03, 2023 @12:11AM (#38505014)
[delayed]
Re:You can't divide by zero – Garrit's Notes by scatters on Sunday December 03, 2023 @01:02AM (#38505190)

    ceil(0.000001) = 1
    ceil(0) =... 0? Wtf?
But that's a perfectly well defined function. Not every function has to be continuous.
Re:You can't divide by zero – Garrit's Notes by kazinator on Sunday December 03, 2023 @03:58AM (#38505809)
In the first place, not every function has to be defined everywhere.
Re:You can't divide by zero – Garrit's Notes by jjgreen on Sunday December 03, 2023 @07:41AM (#38506659)
Well, if 1/x -> infinity as x -> 0, x > 0, and 1/x -> -infinity as x -> 0, x < 0, then the average of +infinity and -infinity is zero. :-)
Re:You can't divide by zero – Garrit's Notes by zmgsabst on Sunday December 03, 2023 @12:12AM (#38505022)
> 0 is always going to be a special case for division in real numbers.

Right — because it’s impossible to have an inverse of zero multiplication.

Eg, 0 = 0 + 0 -> 1 = 1 + 1 -> 0 = 1 if you have a multiplicative inverse to 0, and hence you have collapsed your entire system to a single value.

These are students we’re still teaching that basic algebraic structure to — that it’s not possible to have a multiplicative inverse to zero.

Calling that a “convention” is wrong.

Re:You can't divide by zero – Garrit's Notes by imetatroll on Sunday December 03, 2023 @12:44AM (#38505125)
. . . . . . . . . ------------------------------------------------------->
Re:You can't divide by zero – Garrit's Notes by dang on Sunday December 03, 2023 @01:08AM (#38505212)
Hey, can you please make your substantive points without shallow dismissals or name-calling? This is in the site guidelines: https://news.ycombinator.com/newsguidelines.html.

If you know more than others, that's great, but in that case the thing to do is to share some of what you know, so others can learn. If you don't want to do that, that's fine, but in that case please don't post. Putdowns and swipes only degrade the discussion.

https://hn.algolia.com/?dateRange=all&page=0&prefix=true&sor...