Whilst writing a rather longer article related to floating point, and having recently been sensitized to these sorts of issues, I note the following behaviour:
>>> x=-0.0;y=0.0;print x,y -0.0 -0.0
To my mind this is beyond bonkers, but I’ve been convinced by others before that behaviour I used to think was bonkers may in fact be sensible. The behaviour is obviously caused by the compiler caching the constant values.
Anyone care to defend it?