Mathematica considers two numbers equal if "at most their last seven binary digits" differ. For example:
In:= ep = 2.5*^-14; In:= E == E + ep (* Less than 7 binary digits *) Out= True In:= E == E + 2 ep (* More than 7 *) Out= False
This seems strange but I understand the motivation.
I then wondered if it's possible to construct a chain of equalities with unequal ends but nevertheless evaluates to
True. It turns out no:
In:= E + ep == E + 2 ep Out= True In:= E == E + ep == E + 2 ep (* First and last argument differ *) Out= False
However, if you use
LessEqual (which behaves similarly to Equal) it is possible:
In:= E + 2 ep <= E + ep <= E (* Expected False *) Out= True In:= E + 2 ep <= E (* As in Equal *) Out= False
My question is, is there a reason for this odd behaviour or is it just a quirk to be aware of?