+ 4
Infinity as a result of division by zero
Here is a matter that I would very much appreciate an explanation upon: In elementary school (some forty years ago) we were taught that a division by zero gives a meaningless value! When I was working on this simple calculator code (https://code.sololearn.com/WUowlMNta957/?ref=app) I discovered that JavaScript returns infinity as a result of division by zero. As it turns out, in 1985 the IEEE (in standard 754: https://standards.ieee.org/content/dam/ieee-standards/standards/web/documents/interpretations/754-1985_interp.pdf) decided that division by zero is indeed infinity. But the explanation for this, I could not really understand ... Any simple and clear explanation will be greatly appreciated. TIA
7 Answers
+ 11
//hello sir , might these posts will be helpful , U can search for more posts on javascript & division by 0
https://www.sololearn.com/Discuss/1577408/?ref=app
https://www.sololearn.com/Discuss/1575402/?ref=app
+ 4
Limit x when x approaches zero from RHS for (1/x) ?
http://tutorial.math.lamar.edu/Classes/CalcI/InfiniteLimits.aspx
+ 3
Thank you all for the responses. I will try to understand the issue from the links you provided.
Zsphyr Koo, I checked again the link from ieee - it works fine on my machins (both desktop and cellphone...)
+ 3
Well, Iโm not so sure...
Itโs not a question of doubts... Itโs more of a paradox in my mind. In arithmetics, division by zero is still meaningless and it canโt be both meaningless and infinity at the same time... Even if the IEEE has some mathematics in thiere claim, the more I read about it, it looks more like a way to avoid a crash then real calculation...
I just wander if there will come a time that teachers in schools will stop teaching that division by zero gives a meaningless value and therefore should not be done, and start teaching that it gives infinity...
+ 2
Regarding the behaviour of division by zero in JavaScript, I believe you may find the reference from ECMAScript Language Specification:-
https://www.ecma-international.org/ecma-262/5.1/#sec-11.5.2
P/S: The PDF link provided is broken.
+ 1
Ronen Gil I see, unfortunately I got 404 in my mobile browsers.
Besides, any of the response here clear your doubts or requires further clarification? ๐
+ 1
What drove me to deal with this issue (and Numbers at large) was the philosophy behind it... But I kindly disagree... Infinity is something that usualy is getting larger and larger... zero - no matter how many zeros you add to it - remain a zero! And as for the first part, the issue of division goes the other way around. If we where to discuss on how many zeroes fot in a number - we discuss the issue of dividing zero by a number - and there tge answer is very clear - Itโs zero... But when discussing divisin BY zero - the qusition is how many times does any number fit into zero, or how can you divide a number to zero parts... And the answee to both this questions is -You canโt. Dividing any number to zero parts can not be done because you have to have a number of parts. Even if you donโt divid it at all - you are still left with 1 part. The same way - Any number can not fit into zero - because it leavs it nothing to fit into. The only thing that fits into zero - is zero - and here begins the jurny of the discusion on infinity... Zero fits into zero infinate times... From here we can take the philosophical path to infinity as the result of duvision by zero...
And as I understand the resulution of the IEEE back in 1985 - That is how they began it as well...