Live data from Hacker News

1/0 = 0

hillelwayne.com

51–60 of 593 posts

Re: 1/0 = 0

#51

1/0 = 1(±∞) https://twitter.com/westurner/status/960508624849244160 > How many times does zero go into any number? Infinity. [...] > How many times does zero go into zero? infinity^2?

Zero goes into zero x times, for any real x. Infinity isn't real, therefore neither is infinity^2 so no.

Extrapolate.

What value does 1/x approach?

What about 2/x?

And then, what about ∞/x? What value would we expect that to approach? ∞(±∞)

Re: 1/0 = 0

#52

You know.. dividing is like breaking something up.. If you divide by 2, you break it up into 2 pieces.. if you divide by 0, from some standpoints, you do have nothing, because you broke it up into 0 pieces, and 0 pieces is 0.

  You know.. dividing is like breaking something up [..]
No. What it is 'like' is totally irrelevant and actively harmful to consider if you want to be able to get anything serious done with your programming language. This is not a place to start philosophizing. For consistent arithmetic it is important to know which axioms are fulfilled. Division needs to be a mathematically clearly defined operation.

Re: 1/0 = 0

#53
post #25
post #8

Oh, so 0*0=1 ?

If a hn title said 1*0=0 could you reply "Oh, so 1=0/0?" The entire point of the article was suggesting you can define a consistent system without multiplication and division being entirely symmetrical (as they already are not)

Actually, that's the entire point of 0/0. It's indeterminate, meaning it can only take on a fixed value in the context of an operation to approach it (usually a limit).

Re: 1/0 = 0

#54

This article grinds my gears. He quotes a number of mathematicians that correctly state the undefined nature of 1/0. Then proceeds to interpret that this means that we can choose any specific value to represent as 1/0 that we want. NO. We have "NaN" for a reason and it is an important signal to the programmer that a mistake was made. The language that assigns it to 0 silently is bunk as is this article.

> correctly state the undefined nature of 1/0

Erm, when we say it's "undefined" we mean it literally -- standard mathematical systems of arithmetic do not define a value for that division.

If you make another system of arithmetic you can define it how you want and be consistent with "regular maths" for the operations in which things are defined. It's an extension.

> We have "NaN" for a reason

Funnily enough, IEEE754 defines 1/0 as positive infinity, not Nan. But none of these things are "the truth" in any reasonable sense of the word, just "useful systems".

Defining it as 0 at least means floating point numbers are (presumably) closed under arithmetic operations, which could be handy.

Re: 1/0 = 0

#55

Earlier quoted context omitted.

It is inconsistent. If 1/0 = 0, then 1 = 0*0.

Wait, if 1 / 0 = infinity, then infinity * 0 = 1 This seems just as bizarre, since zero times anything shouldn't become 1, no matter how big or how many times you do it.

Yes, that's correct. The fact that 1/0 shouldn't be defined as infinity isn't an argument that it should be defined as 0.

Re: 1/0 = 0

#56
post #20

Earlier quoted context omitted.

I would say an exception is much more convenient. Buggy code that silently continues to run is very hard to debug!

I used to think the same way: let's throw an exception on divide by zero, and forget NaN like a bad dream! But then someone explained to me that it's common to feed a billion numbers into a long calculation, then look at the results in the morning and find them okay, apart from a few NaNs. If each NaN led to an exception, you'd come back in the morning and find that your program has stopped halfway through. So there'…

Typically, divide by zero throws for integers because they can’t express NaN, which can instead be returned for floating point. In any case, integers can’t express special values, so you get exceptions instead. And this is actually defined at the processor level (for x86 among others), the trap is free (well, a sunk cost), why not take it?

Zero is not a very good NaN.

Re: 1/0 = 0

#57
> But is Pony doing something unsound? Absolutely not. It is totally fine to define 1/0 = 0. Nothing breaks

a=x/N

b=y/N

If a==b, then x==y

No longer true, with this change. Essentially a variety of mathematical properties of numbers in the Real space don't hold when you allow division by 0.

Re: 1/0 = 0

#58
While I fully agree, I'd like to point out that reducing specifically to 0/0 = 0 is more generally useful (ie. maintains intuition) than x/0 = 0, which breaks intuition.

Given a/b = c, your intuition of finding c is to get a number such that c×b = a.

c×0 = 0 has an infinite number of solutions, 0 being a particularly practical one.

c×0 = 1 (and more generally a≠0) has no solution, especially in the reduced explanation of multiplication as taking integer multiples of a value.

(Also note that having 0/0 = 0 maintains symmetry and continuity of the function y = 0/x.)

Re: 1/0 = 0

#60
Some people say "oh, that's easy, 1/0 is +Infinity". So the real fun is at 0/0.

The limit of x/y as x and y go to zero depends on which path across the xy plane you take towards the singularity. Along one approach, the limit is 0, along another approach the limit diverges to infinity, along yet another the limit is 17.

I'm not kidding! Go to https://www.geogebra.org/3d and enter "x/y" and spin the graph around. The "value" at x=0 y=0 is the entirety of the z-axis.

For another perspective, try http://www.wolframalpha.com/input/?i=z%3Dx%2Fy and turn on contour mode for the 3D plot. Notice how the contour lines radiate out from the z-axis; each of those is an "approach" to the singularity at a different z-value, and taking the limit along each line leads to a different value.

Post reply on HN