Re:1/0 = 0
by ushi on Friday August 10, 2018 @05:20PM
(#17736834)
Ruby defines division by zero for Floats
and
I think infinity is a more intuitive result, but most of the time i get this as a user i would rather see 0 (bought books per month: Infinity). As a programmer i like to get an error, because i forgot to handle an edge case...
[ Parent
| on HN ]
Re:1/0 = 0
by scarejunba on Friday August 10, 2018 @05:30PM
(#17736889)
That's IEEE 754 https://en.wikipedia.org/wiki/IEEE_754#Exception_handling
Re:1/0 = 0
by nostalgeek on Friday August 10, 2018 @05:43PM
(#17736958)
AFAIK Javascript does this as well.