Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But for numbers, a zero is not considered null, because it was handled in the operators rules.


Numerical zero has nothing to do with the issue discussed here. What you are proposing is to add another “number” to types like int and float that results in the program crashing whenever you try to add it to another number.


It does! It's the numerical "null object", just like the empty string and empty collection.


> What you are proposing is to add another “number” to types like int and float that results in the program crashing whenever you try to add it to another number.

There's already division by zero and NaN to trip you up in IEEE754.


Or there's NaN which just results in NaN and doesn't equal itself. No need to crash.


I think it does




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

Search: