$MachineEpsilon
x = 0.0000000000000001
% + 1
% - 1
As expected the final result equals zero, since x < MachineEpsilon ($2.22045\times10^{-16}$).
However, if I double x (to 0.0000000000000002), then the final result should in my understanding still be zero, since x is still smaller than the MachineEpsilon, but... to my surprise the final result isn't zero! Question: why is this?
Note 1: If I triple x (to 0.0000000000000003), then x is larger than the MachineEpsilon and indeed the final result is bigger than zero.
Note 2: On my computer the value for MachineEpsilon is $2.22045\times10^{-16}$ Is this the same as on any computer using Mathematica by the way?
EDIT: I noticed that in binary form:
- The MachineEpsilon is $1.\times2^{-52}$
- And 0.0000000000000002 is $1.1100110100101011001\times2^{-53}$
Code:
BaseForm[$MachineEpsilon, 2]
x = BaseForm[0.0000000000000002, 2]
% + 1
BaseForm[% - 1, 2]
Therefore, could it be that $1.1100110100101011001\times2^{-53}$ is rounded up to $1.\times2^{-52}$ if $1$ is added? Which is precisely equal to the MachineEpsilon and that therefore the final result above with 0.0000000000000002 isn't zero but... the MachineEpsilon!?