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

What is the sign of 0?

It's 0.



Parent was talking about the sign of the numerator. But... zero in IEEE 754 representation has a meaningful sign bit. 1/-0 = -inf.


Or as IEEE 754 sees it (you can try this in your JavaScript REPL).

  >> 1 / 0
  Infinity
  >> 1 / -0
  -Infinity




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

Search: