Live data from Hacker News

1/0 = 0

hillelwayne.com

21–30 of 593 posts

Re: 1/0 = 0

#21

Earlier quoted context omitted.

I think OP means that nothing breaks mathematically. It is not inconsistent and not false, so you can work with it. The only issue is to deal specially with the case of division by zero, which you have to do anyways. Code that assumes that (x/y) * y = x is wrong if you don't check for y = 0, independently of what you define x/0 to be.

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

1/0 = undef (cast to 0)

1 != 0*0

I don't see the inconsistency. Abstract math vs practical application.

Re: 1/0 = 0

#22
post #10

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.. 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. And dividing by 0.5 is breaking into how many pieces exactly?

The analogy actually holds - below 1 it reverses and you 'unbreak' your something (which is now halved) into a larger one.

Re: 1/0 = 0

#23
post #10

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.. 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. And dividing by 0.5 is breaking into how many pieces exactly?

I guess its more flipped. How many pieces equal the whole, not how many pieces can the whole be broken up into. That's why you can't divide by 0, any number of nothing can't make a whole.

*disclamer: I have no math background whatso ever

Re: 1/0 = 0

#24
post #4

I mean sure Pony, but as a programmer this result would surprise me quite a lot, which I tend to view as a bad thing. https://en.wikipedia.org/wiki/Principle_of_least_astonishmen... However: > One of developers of Pony reached out to me. They’re planning on writing a more in-depth explanation of why Pony chose 1/0 == 0, which I will linked when available. As I understand it, it’s because Pony forces you to handle all…

Based on the tweet, I don't expect it to be very enlightening. Since programmers write programs to solve real problems, and real problems define 1/0=undefined... then this is only going to mask bugs in those programs.

Re: 1/0 = 0

#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)

Re: 1/0 = 0

#26
post #10

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.. 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. And dividing by 0.5 is breaking into how many pieces exactly?

I guess its more flipped. How many pieces equal the whole, not how many pieces can the whole be broken up into. That's why you can't divide by 0, any number of nothing can't make a whole.

So all that to say: We can't treat 0 like a number.

*disclaimer: I have no math background whatsoever, this is just a fun topic.

Re: 1/0 = 0

#27
> We’ve now established that if we choose some constant C, then defining division such that x/0 = C does not lead to any inconsistencies.

No, you haven't. You've merely failed to locate any. You've said "I'm not going to prove that this works. I'm going to assume that it does and act as if it did, and place the burden on you to prove otherwise."

Re: 1/0 = 0

#28

> But is Pony doing something unsound? Absolutely not. It is totally fine to define 1/0 = 0. Nothing breaks It actually does break something, the symmetry between division and multiplication and the many pieces of code that assume that (x / y) * y equals x. Here is a naive and non practical example, but it is not impossible to find a real world example where this simplified code manifests itself accidentally or by de…

What if number types were Optionals after any operation that could result in any kind of unusual number (sqrt(-1), Infinity, NaN)? Or maybe after every operation, since any operation could overflow the type.

Do any languages do that? Seems more consistent (if way more hassle) than giving a mathematically false result out of pragmatism. At least in a strictly typed language.

Re: 1/0 = 0

#29
This triggered an immediate "that is wrong!" response from me, which I had to suppress to actually read the argument.

From this definition, I'd guess that pony isn't optimized for numerical code and floating point operations, because there it tends to make less sense.

Re: 1/0 = 0

#30
post #5

My two issue with this is it totally relies on a specially constructed definition, and it leads to unintuitive results. The issue with special definitions is you can use them to say anything you want, turning regular, common operations into weirdness. What does it mean to take a factorial on the real numbers, or to add only on the even integers? In both cases, we're twisting what are generally accepted mechanics and…

> What does it mean to take a factorial on the real numbers, or to add only on the even integers?

I don't think that's exactly the same problem.

It is perfectly valid to define an operation on a particular domain. Defining an add operation on even numbers is perfectly fine (If you had said odd, well...). Factorial on real numbers is more or less the Gamma function. The problem here is that the operation is defined on one domain...

> We can say that division’s domain is all the real numbers except zero.

...but then, for some reason, it is decided that will will be applied on a different domain. That is, that we're going to apply on all real numbers including zero. So now we need to modify the definition of the operation. And the thing is that, the new definition, created to accommodate the new domain, usually tends to produce friction precisely on the new elements added to the domain. We excluded zero initially because that way the operation was defined in a simpler way. Now, having to consider zero implies that our definition becomes more "complex".

Now, we can change the definition in different ways. Is any one of those objectively "better" or "worse" than the rest? Well, that's what the discussion is all about.

Post reply on HN