I stumbled over the following weird behavior when comparing floating-point numbers close to 1.0:
qq = 1.0 + 60.0 $MachineEpsilon;
and then
qq > 1.0
yields False. However,
qq - 1
yields
1.33227*10^-14
which is far above $MachineEpsilon = 2.22045*10^-16 (the smallest number eps satisfying (1.0 + eps > 1.0)==True when using 8-byte floating point numbers). Changing the first command to
qq = 1.0 + 65.0 $MachineEpsilon;
Leads to the expected behavior of (qq > 1.0) == True.
I'm running Mathematica 10.4.0.0 under Windows on an Intel i5.
Ron
SetPrecision[qq, MachinePrecision] > 1– Feyre Dec 06 '16 at 11:54False. – corey979 Dec 06 '16 at 12:0216or higher,MachinePrecisiononly works with aqqrationalized asqq = 1 + 60 $MachineEpsilon, something I did without thought, first idea with precision issues is always using rational numbers. – Feyre Dec 06 '16 at 12:06Equalis fuzzy and mutually exclusive trichotomy is enforced. – Daniel Lichtblau Dec 06 '16 at 14:47