# Configurable tolerance for numerical equality?

In standard C++ the double values for 1. + 1.2*^-16 and 1. are not considered equal. But in Mathematica, I get the following:

With[{aux = 1 + 1.2*^-16},
{{1 == aux, 1. == aux}, {1 < aux, 1. < aux}, {ArcSin[aux], ArcSin[1.]}}]


returns

{{True, True}, {False, False}, {1.5708 - 2.10734*10^-8 I, 1.5708}}


Is there a parameter that I can set, to get the behaviour as in C++, i.e. strict floating point equality?

• Welcome to Mathematica.SE! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – user9660 Feb 28 '16 at 13:42

See How to make the computer consider two numbers equal up to a certain precision and the linked SO answer for more details. This question is similar to the first one, except the OP here wants the tolerance to be $-\infty$, instead of greater.
Block[{Internal$EqualTolerance = -∞}, 1 +$MachineEpsilon == 1.
1 + $MachineEpsilon == 1. (* False True *)  • Perhaps this question should be considered a duplicate? – Michael E2 Feb 28 '16 at 14:36 • For zero bits tolerance, Internal$EqualTolerance should be -Infinity. A value of 0 leaves 1 bit tolerance. – Oleksandr R. Feb 28 '16 at 18:28