2 ms·
Erlang too, now and in the future will say that minuszero==zero, it's a different more specific operator that's changing. You'll get the same in python with >
by Y_Y 4y ago
Erlang too, now and in the future will say that minuszero==zero, it's a different more specific operator that's changing.
You'll get the same in python with
>>> -0. is 0.
False
- Kwpolska 4y agoThe `is` operator is checking object identity by comparing addresses. It is useless, although it may sometimes produce reasonable-looking results due to optimisations. Python 3.11 gives me this: >>> -0 is 0 <stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="? True Because (a) -0 is an integer, and there is only one integer zero, (b) small numbers have only one instance in memory as an optimization.