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 explanatio…
1/0 = 0
71–80 of 593 posts
Re: 1/0 = 0
#72When encountering such unanticipated corner cases, it's almost always better to throw an error. That prevents any further data/state corruption from happening. It prevents your user from getting back a bad result which she thinks she can trust and rely on. It highlights the problem very clearly, so that you know you have a problem, and that you have to fix it. Simply returning a 0 does the exact opposite.
If you're one of the 0.1% who did anticipate all this, and correctly intended for your program to treat 1/0 as 0, then just check for this case explicitly and make it behave the way you wanted. The authors of pony are welcome to design their language any way they want. But in this case, they are hurting their users far more than they are helping.
Re: 1/0 = 0
#73Earlier quoted context omitted.
1/0 = undef (cast to 0) 1 != 0*0 I don't see the inconsistency. Abstract math vs practical application.
You’re doing something different than real number arithmetic. Saying 1/0 = x, and then treating x like a real number is inconsistent. But just saying “we are going to augment the real numbers with an element x that is not a real number, and then define some properties of x and prove things about it” is not.
Computer languages execute on rules that are not utilizing real number arithmetic. I didn't want to mention it, but there's these things called floats...
Edit: Pony took out the "normal" version of division by zero and suggest to write a wrapper to check beforehand.
Re: 1/0 = 0
#74> 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
#75Unlike what the author says, this is the total opposite to a practical/pragmatic solution. He does not prove that this is a useful representation, only that given his own axioms, this can be considered mathematically correct. Very practical issues with 1/0 == 0: - This result is counter-intuitive, took building a custom fields and responding to the incredulity of all. - The main reason this is counter-intuitive is no…
Re: 1/0 = 0
#76You 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.
Re: 1/0 = 0
#77While 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 explanatio…
But this is not for man of industry!
Re: 1/0 = 0
#78Earlier quoted context omitted.
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.
In geometric modeling kinds of applications, I would say that these definitions are typically desirable, with 1/0 = undefined only better in unusual cases. As a simple example, it is typically much more useful for the “tangent” of a right angle to be defined as ∞ than left undefined.
But anyhow, there are no “facts” involved here. Only different choices of mathematical models, which can be more or less convenient depending on context / application.
Re: 1/0 = 0
#79Re: 1/0 = 0
#80There is no proof in this post that 1/0 = 0 maintains consistency. Rather, it contains refutations of one or two arguments that claim inconsistency, along with appeals to authority.