Live data from Hacker News

1/0 = 0

hillelwayne.com

91–100 of 593 posts

Re: 1/0 = 0

#91
post #41

When setting out to add a new axiom to a heavily studied area of mathematics, perhaps one should at least formulate an argument that isn't shown to be incomplete with the most basic wikipedia search. https://en.wikipedia.org/wiki/Division_by_zero

[deleted]

Re: 1/0 = 0

#92

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.

You didn't read the article, did you?

Re: 1/0 = 0

#93
post #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 "…

That's a wonderful graphing website from the look of it!

Re: 1/0 = 0

#94
post #72

My problem with "1/0 = 0" is that it's essentially masking what's almost always a bug in your program. If you have a program that's performing divide-by-zeroes, that's almost surely something you did not intend for. It's a corner case that you failed to anticipate and plan for. And because you didn't plan for it, whatever result you get for 1/0 is almost surely a result that you wouldn't want to have returned to the…

I almost want two different division operations: One where 1/0 = 0, exclusively for use in progress bars and stuff like that, and another one for everything else.

Because frequently division by zero indicates a bug. But similarly frequently, I end up crapping out annoying little bits of code like

  if (foo == 0):
    return 0
  else:
    return bar / foo

Re: 1/0 = 0

#95
post #16

It's like in Ruby, when you divide 3/2 you get 1 (integer division) which is almost never the behavior you want (unless you cast all you numbers to float which is a pain to do).

In Ruby there is % which gives you remainders.

When we first teach children about division we teach them that, "17/5 = 3 with a remainder of 2". It is only later that they learn about decimal points and learn to say that 3.4 is the answer.

Re: 1/0 = 0

#96
post #20

Earlier quoted context omitted.

> the many pieces of code that assume that (x / y) * y equals x The same issue if division by zero throws an exception. This is simply a more practical approach that dispenses with the exception handling (ie becomes a less irregular test case). Edit: Not buggy behavior, when expected.

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

It's not convenient at all in a language like Coq.

Re: 1/0 = 0

#97
So... if I do:

   x = a/b + c/d + e/(f*g/h)
I need to check:

   if(b == 0 || d == 0 || f == 0 || g == 0)
rather then:

   if(isFinite(x)) 
Or whatever function/equality check is appropriate, or a try/catch if it throws an exception.

I have to say that using a single check on the result seems significantly less prone to bugs then having to check all the values that could produce an invalid result.

Re: 1/0 = 0

#98

> 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…

> …any pieces of code that assume that (x / y) * y equals x…

What? If you’re using integers or floating-point numbers, that has never been true in general. Consider x=1, y=49 in the realm of IEEE doubles. Addition isn’t even associative, consider 1e-50 + 1 - 1.

Re: 1/0 = 0

#99
post #43
post #25

Earlier quoted context omitted.

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)

> without multiplication and division being entirely symmetrical (as they already are not) What do you mean?

Multiplication by x and division by x are inverses, except there is already the sole special case of x=0 where that isn't true.

The common way to resolve that is and be consistent is to axiomatically decide:

1) there is no inverse of * 0

2) 0 is not part of the range permitted for 1/x

The point of the article is that another way to resolve it and be consistent is to axiomatically decide:

1) there is no inverse of * 0

2) 0 is part of the range permitted for 1/x, and the resulting value is 0.

As in, (x/y) * y=x is true either way only if y!=0. The only difference is whether when y=0 if it is not true because it is just illegal or if it is not true because (x/0) * 0 = 0 for all x.

Re: 1/0 = 0

#100

Unlike 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…

I think this is calling for a Pony programmer working with floating point to know how their own basic operators function. Wrapping division in a function that checks for zero will give you the proper result you would like to return.
Post reply on HN