Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is 0 divided by 0 an error?

Tags:

I have come across this problem in a calculation I do in my code, where the divisor is 0 if the divident is 0 too. In my code I return 0 for that case. I am wondering, while division by zero is generally undefined, why not make an exception for this case? My understanding why division by zero is undefined is basically that it cannot be reversed. However, I do not see this problem in the case 0/0.

EDIT OK, so this question spawned a lot of discussion. I made the mistake of over-eagerly accepting an answer based on the fact that it received a lot of votes. I now accepted AakashM's answer, because it provides an idea on how to analyze the problem.

like image 381
Björn Pollex Avatar asked Jul 13 '10 11:07

Björn Pollex


1 Answers

Let's say:

0/0 = x

Now, rearranging the equation (multiplying both sides by 0) gives:

x * 0 = 0

Now do you see the problem? There are an infinite number of values for x as anything multiplied by 0 is 0.

like image 120
Yacoby Avatar answered Sep 20 '22 15:09

Yacoby