Hacker News new | past | comments | ask | show | jobs | submit login

The inverse of zero is infinity? Shouldn't it be undefined?



Not if you know that it's positive or negative. The inverse of a negative infinitesimal can't be anything other than a negative infinite number, and the inverse of a positive infinitesimal can't be anything other than a positive infinite number. There's no difficulty with the definitions.


There is the difficulty that you don't actually have zero, you have postive and negative infinitesimal.


That is the meaning of "+0.0" and "-0.0". Actual zero is neither.


The limit of a function 1/x as x approaches zero from the left or right is well defined as negative or positive infinity respectively. The limit is only undefined when no approach direction is specified (as the results from the left and right do not agree)


Floating point is a real trip. They should probably spend more time going over its intricacies in programming courses, because its not going anywhere.

E.g. you should hardly ever test floating point numbers for equality. Instead you usually check if they are "close enough" within an expected precision.


Floating point numbers represent the extended real set, where infinity exists. What is completely different from the integral numbers most computers use, on those division by zero is undefined.


Division by zero is still undefined in the extended reals. To define it you'd need something like the projective reals. But it doesn't matter; floating point numbers don't have a zero; they have two zeroes of different signs.


Not if you're following IEEE-754.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: