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

Is there any language that treats the zeros as unequal? That would seem like the real "screw IEEE".



in the specific case of erlang, and the erlang beam vms,

0 !== 0.0

Of course 0 == 0.0

I imagine if they had chosen to follow IEEE, it would have been that 0.0 !== -0.0 and 0.0 == 0.0.


I don't know erlang, but it looks to me like that's a difference between types. (integer vs float)

Is there a language that treats different float values of zero as unequal? That would be surprising to me. And possibly silly.


What a guess! I guessed "Julia" and that is correct: https://stackoverflow.com/questions/38601141/what-is-the-dif...

In Julia 0.0 == -0.0 but 0.0 === -0.0 evaluates to false.

Note that -0.0 and 0.0 are different at the binary representation level, which is what === checks for.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: