Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results for equaltolerance
Search options not deleted
41 votes
Accepted

Is there a difference between Divide[a,b] and a/b?

Again, keep in mind that even === has some tolerance (Internal`$SameQTolerance) when comparing machine precision numbers (though less than ==, Internal`$EqualTolerance) and 15/137. === Divide[15, 137.] …
Szabolcs's user avatar
  • 236k
26 votes
Accepted

Why am I getting that $0.999999999999988 \geq 1.0$ is True?

You can lower the value of Internal`$EqualTolerance: Block[{Internal`$EqualTolerance = 0}, 0.999999999999988 >= 1.0 ] False This can lead to unexpected behaviors too: Block[{Internal`$EqualTolerance … NumericQ] := Block[{Internal`$EqualTolerance = x}, Boole[Not[0.999999999999988 >= 1.0] && (0.1 + 0.2 == 0.3)] ] Plot[correctEquals[x], {x, 0, Internal`$EqualTolerance}] …
Greg Hurst's user avatar
  • 36.8k
23 votes

How to make the computer consider two numbers equal up to a certain precision

There are two undocumented functions which control the tolerance of Equal and SameQ: Internal`$EqualTolerance and Internal`$SameQTolerance. …
Alexey Popkov's user avatar
20 votes
6 answers
2k views

How to remove duplicates from set of machine precision 2D points?

So what is the fastest way to get rid of duplicates while allowing for a tolerance of comparisons, and preferably being able to control it (Internal`$EqualTolerance, Internal`$SameQTolerance)? …
Szabolcs's user avatar
  • 236k
15 votes
Accepted

Different floating-point numbers equal?

The proper comparison is Block[{Internal`$EqualTolerance = -Infinity}, 1 == 1 + $MachineEpsilon] (* False *) Block[{Internal`$EqualTolerance = -Infinity}, 1 == 1 + $MachineEpsilon/2] (* True *) In … fact, the value of Internal`$EqualTolerance * Log2[10] is 7., meaning that it ignores the last seven bits, just as I discovered! …
2012rcampion's user avatar
  • 7,901
13 votes

What is wrong with RuleCondition here?

For completeness: Internal`$EqualTolerance and Internal`$HashTolerance have no effect. The test is definitely SameQ. …
Oleksandr R.'s user avatar
  • 23.1k
11 votes

Machine-Precision and Arbitrary Precision

C definition of $MachineEpsilon Mathematica's view: floating-point numbers as distributions The nature of the distribution: interval arithmetic versus Gaussian error propagation $EqualTolerance; $SameQTolerance …
11 votes
Accepted

IntegerPart - is this a known bug?

You can change the tolerance used by Equal with Internal`$EqualTolerance. …
Michael E2's user avatar
  • 245k
11 votes
Accepted

A list containing zero elements

(You might google for Internal`$EqualTolerance and Internal`$SameQTolerance if you wish to learn about these tolerances.) …
Szabolcs's user avatar
  • 236k
11 votes
Accepted

Can Someone Please Explain Internal`$SameQTolerance?

Internal`$EqualTolerance = N @ Log10[2^4]; a == b Internal`$EqualTolerance = N @ Log10[2^5]; a == b False True $SameQTolerance behaves the same only it applies to SameQ rather than Equal: Internal … ^13]; a == b Internal`$EqualTolerance = N@Log10[2^14]; a == b False True …
Mr.Wizard's user avatar
  • 273k
10 votes
Accepted

How to remove duplicates from set of machine precision 2D points?

It must be said that this is still not as fast as Union, but at least it acknowledges Internal`$EqualTolerance while being faster than Split. … The value of Internal`$EqualTolerance is actually hard-coded into the bytecode on compilation, so it will be necessary to recompile if a different tolerance is required. …
Oleksandr R.'s user avatar
  • 23.1k
10 votes
Accepted

Machine Epsilon

There is a tolerance Internal`$EqualTolerance that is applied when testing Real numbers. If the numbers agree up to the last Internal`$EqualTolerance digits, then they are treated as equal. … Try this: eps = 1.0; p = 0; Block[{Internal`$EqualTolerance = 0.}, While[(1.0 + eps) > 1.0, eps = eps/2.0; p += 1]; ] eps p eps*2 (* 1.11022*10^-16 53 2.22045*10^-16 *) See How to make the computer …
Michael E2's user avatar
  • 245k
9 votes
Accepted

Unexpected behavior from CoordinateBoundingBoxArray with Into[1] and 0.41

Another workaround is to create a Floor that applies a machine-precision fudge factor, in the way that Equal has the fudge factor Internal`$EqualTolerance. … TrueQ[$in] := Block[{$in = True}, (* Villegas-Gayley *) Floor[x + 10^Internal`$EqualTolerance $MachineEpsilon Abs[x]]]; Protect@Floor; CoordinateBoundingBoxArray[v, rest] ]; Or even more …
Michael E2's user avatar
  • 245k
9 votes
Accepted

Bad Float Counts? (Length[xs] != Total@Counts[xs])

In Mathematica similar (but relative) tolerances are built into SameQ and Equal, which are controlled by the the internal system parameters Internal`$SameQTolerance and Internal`$EqualTolerance respectively … out that the tolerance can be as small as 0.55, which is close to the value of Log10[4.] = 0.60.. that would be predicted by the observed rounding error): Block[{Internal`$SameQTolerance = Internal`$EqualTolerance
Michael E2's user avatar
  • 245k
8 votes
2 answers
131 views

Robust DuplicateFreeQ for numerical data

Compare like Equal does (or in a similar way), with adjustable tolerance (see Internal`$EqualTolerance). It must work with at least machine precision numbers. …
Szabolcs's user avatar
  • 236k

15 30 50 per page