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

Signed infinity is nowhere near the 'expected result'. Zero has no sign. NAN would be a better result off the top of my head.

But I see from the standard that dividing by zero returns infinity with the xor of the dividend and divisor. This also makes no sense - since zero has no sign, its not possible to tell what kind of infinity would result. It's strange that the standard permits both the infinity result from dividing by zero, and simultaneously supports signed zero.

<edit: add xor>




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

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

Search: