Re:In Erlang/OTP 27, +0.0 will no longer be exactly equal to...
by Kwpolska on Tuesday May 09, 2023 @06:01PM
(#35880943)
The `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.
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.