Elixir Consulting Group

Published October 29, 2026 ยท Independent educational guide

Read Absolute and Relative Tolerances Before Calling AI Numbers Equal

An AI explanation can call two numbers equal when the underlying comparison only says that their difference falls inside a chosen tolerance. Before relying on that wording, identify the actual values, their units and the rule used to compare them. Exact equality, rounded display equality and approximate numerical closeness answer different questions. A useful explanation preserves the question that was actually evaluated and the assumptions that made its result possible.

This guide develops an original review workflow through six fictional numerical cases. It does not evaluate a model, client dataset, measurement instrument or production application. The examples use deliberately chosen finite rational numbers and explicit tolerances. Their checks concern arithmetic and the supplied comparison rule, not semantic accuracy, business acceptance, safety or professional approval. No universal tolerance is recommended. The right numerical rule for a real task needs justification from that task and its evidence.

State what the closeness rule compares

Python's official math documentation describes isclose through an absolute difference bounded by the larger of an absolute allowance and a relative allowance. The relative part uses the larger magnitude of the two values. This guide uses that limited formula context while doing its fictional arithmetic with exact fractions. It does not claim to implement every library behavior or test floating-point conformance. The local checking runtime is Python 3.12.14; the linked Python 3.12 documentation currently describes maintenance version 3.12.16.

For the finite examples here, write the rule explicitly: the absolute difference between a and b must be no larger than max of the absolute tolerance and the relative tolerance multiplied by max of absolute a and absolute b. Naming each part is more useful than saying approximately equal without explanation. The absolute allowance carries the units of the compared values; the relative tolerance is dimensionless. Changing either part can change the result without changing either input value.

Case A compares the authored values one hundred and one hundred one. Their difference is one. With a relative tolerance of one hundredth and an absolute tolerance of zero, the relative allowance is one hundred one hundredths, or 1.01. One is within that allowance, so the declared closeness rule passes. Exact equality remains false. An assistant can report that the supplied comparison passes, but it should not rewrite the values as identical or infer that a one-unit difference has no practical consequence.

Put the rule beside the conclusion in a review note. A sentence such as these supplied values pass the declared one-percent relative comparison is narrower and more inspectable than these values are the same. It still requires a separate decision about whether that rule belongs in the real task. If the source does not name a tolerance, ask for it or leave the comparison open. Do not treat the presence of a convenient software default as the missing task justification.

Separate a fixed allowance from a scale-dependent allowance

An absolute tolerance permits a fixed numerical difference in the stated unit. A relative tolerance permits a difference that depends on the compared magnitudes under the chosen formula. These are different policies, and neither is automatically the correct interpretation of a reported discrepancy. A fixed allowance may be meaningful when a real requirement is expressed in a fixed unit. A proportional allowance may answer another question. Establish the requirement before presenting a passing result as evidence of acceptability.

Case B compares two authored pairs: ten with eleven, and one thousand with one thousand one. Each pair differs by one. Under a relative-only tolerance of one hundredth, the first allowance is eleven hundredths and the second is ten and one hundredth. The first pair fails while the second passes. Under a separate absolute-only allowance of one, both pairs pass at the boundary. The inputs have not changed; the named comparison rule has changed.

This contrast is useful when an AI report treats a one-unit difference consistently in words but inconsistently in calculations. It might be applying a proportional rule without telling the reader. Ask it to show the absolute difference, the magnitude used for scaling and the resulting allowance. Then compare those fields with the intended rule. A larger reference value can create a larger relative allowance without demonstrating that the larger case deserves more operational flexibility.

Preserve the sign and direction of the original values even when the comparison uses absolute magnitudes. A symmetric closeness result does not describe whether a quantity increased or decreased. A separate signed difference can answer that question. Keep the signed change, absolute discrepancy and closeness result in separate fields so that shortening the explanation does not erase information. A single true or false result cannot carry all three meanings.

Give comparisons near zero their own explanation

A proportional allowance behaves differently near zero because its numerical size follows the input magnitudes. Do not describe zero as merely another ordinary scale without checking the formula. If a task needs a fixed allowance near zero, identify that allowance and its unit explicitly. An assistant should not add an arbitrary small number simply to make an example pass, and it should not assume that a nonzero result close in everyday language meets a particular numerical comparison.

Case C compares zero with one thousandth. The absolute difference is one thousandth. With relative tolerance one hundredth and absolute tolerance zero, the allowance is one hundred-thousandth, or 0.00001, so the pair fails. In a separate comparison with a declared absolute allowance of one thousandth, the pair passes at the boundary. The second rule was deliberately supplied. It was not discovered from a measurement, inferred from the word negligible or recommended for a real process.

A bounded explanation should identify which allowance controlled the comparison. If the absolute part is larger, say so. If the relative part is larger, show the magnitude that produced it. If both are equal, preserve that fact without inventing a priority between them. This is particularly useful when a report contains values at several scales. The same pair of configured tolerances can be controlled by different parts of the formula for different rows.

Missing values are a separate issue from values near zero. A blank cell or unknown reference does not become zero merely because the comparison needs an input. Before applying a numerical rule, identify which values have actually been supplied and which remain unknown. An explanation that substitutes zero silently changes the question. Keep an unresolved comparison unresolved until the input relationship is established, even if a hypothetical zero case is useful for showing why the missing information matters.

Convert the tolerance when you convert the unit

A comparison can change accidentally when the values are converted but an absolute allowance is left in its old numerical form. Attach the unit to the allowance, just as you would attach it to the inputs. Relative tolerance is dimensionless, but an absolute tolerance is a quantity in the compared unit. A consistent positive scaling changes both values, their absolute difference and their absolute allowance by the same factor.

Case D supplies three minutes and 3.01 minutes, together with an absolute tolerance of 0.02 minutes and no relative allowance. The difference is 0.01 minutes and the comparison passes. Converting the values to seconds produces one hundred eighty and 180.6 seconds. The corresponding allowance is 1.2 seconds, and the difference is 0.6 seconds, so the consistently converted comparison also passes. The example uses authored quantities, not observed task durations or an actual clock.

If someone carries over the bare number 0.02 as seconds, the converted comparison fails because 0.6 is greater than 0.02. That is a different allowance, not evidence that changing the unit changed the underlying discrepancy. An AI summary should identify the unit mismatch rather than describing the second calculation as a deterioration in performance. Review each field that has dimensions, including thresholds, uncertainty bounds and allowances, before accepting a table conversion.

A useful review prompt can ask the assistant to return the original values, original unit, converted values, conversion factor and converted absolute tolerance. Check the conversion yourself. Do not ask it merely whether the two numbers are still close, because that hides the transformation that needs review. This guide provides a way to structure the question, not an observed model response, a general unit-conversion certification or an instruction to approve a real operational result.

Do not use closeness as an identity relation

A numerical comparison rule can be useful for a pair without defining groups of interchangeable records. In particular, a chain of pairwise passing results can fail to connect its endpoints. Do not use an intuitive phrase such as all roughly the same to merge records, discard distinctions or choose a representative unless a separate grouping rule has been justified. Record identity, quantity comparison and clustering are different tasks.

Case E supplies the values zero, nine tenths and nine fifths. The absolute tolerance is one and the relative tolerance is zero. Zero and nine tenths pass because their difference is 0.9. Nine tenths and nine fifths also pass for the same reason. Zero and nine fifths fail because their difference is 1.8. The authored rule is symmetric for each pair, but these three values show that a chain of passing pairs does not guarantee a passing endpoint pair.

This matters when a proposed report deduplicates numerical records by repeatedly joining close neighbors. The final group can contain values that would not pass the original pairwise comparison. That does not prove the grouping method is always unsuitable; it shows that the grouping question needs its own definition. Ask what property the group is required to preserve and how a representative is selected. Do not infer those decisions from the pairwise tolerance alone.

Keep a literal record identifier even when two values pass the comparison. Two rows with different identifiers do not become the same observation because their numerical fields are close. Conversely, two versions of the same supplied record can contain different values. Identify the relationship actually established by the source before using closeness to explain a revision. No actual record merge, duplicate finding, identity resolution or destination change is performed in this guide.

Keep the comparison population visible

A summary proportion is meaningful only after the compared pairs and denominator have been defined. Identify the source and status of each pair. A proportion over completed comparisons cannot be presented as the proportion for a full list containing unresolved references. Nor does a passing proportion establish whether the chosen allowance is appropriate. Separate the arithmetic over supplied cases from the evaluation design and the broader decision someone hopes to make.

Case F invents three pairs. The first is ten and ten, the second is twenty and twenty-one, and the third is thirty with its comparison value unknown. The declared rule uses an absolute allowance of one and a relative allowance of zero. Both completed pairs pass, so the completed-pair proportion is two out of two. Input availability is two out of three. The full three-pair passing proportion is unresolved because the third comparison is not supplied.

Two explicit hypotheses show why the unknown matters. If the third comparison value were thirty, all three pairs would pass. If it were thirty-two, only two of three would pass. These are authored alternatives, not predicted values or observed model outputs. Neither should be inserted into the actual list to manufacture a complete result. Keep the completed subset, its selection process and the unresolved field visible wherever the summary is reused.

For a real evaluation, also ask how the cases were selected and whether they represent the intended task. Repeating a favorable pair changes a count without adding a new independent observation. Weighting some pairs changes the summary question. An allowance chosen after inspecting failures can make a development result look better without providing a fresh evaluation. These are reasons to examine the design; the small fictional cases here establish no population accuracy, fairness, generalization or release threshold.

Inspect the boundary using the supplied values

A comparison that includes its boundary answers a different question from one that requires a strictly smaller discrepancy. In case B, the absolute-only rule accepts a difference of exactly one because the allowance is also one. Replacing less than or equal to with strictly less than would reject that boundary pair. Keep the operator visible when an assistant translates a formula into prose. Within the allowance can otherwise become an imprecise phrase that hides the distinction.

The examples use exact fractions so that the boundary question is separate from floating-point representation. That design choice does not mean a real application's decimal input, binary conversion and comparison will behave identically for every value. If a real result depends on a boundary, inspect the actual representations and implementation involved. Do not claim that a rational teaching calculation has tested an application that was never run. A useful follow-up identifies the representation question directly instead of explaining every discrepancy as a generic rounding issue.

Display rounding deserves a separate note because it can make different underlying values look alike. Imagine a report presenting both members of a pair with only one decimal place. A reviewer still needs to know whether the comparison used those displayed strings, parsed displayed numbers or the original underlying quantities. These are different inputs. A display can support a reading task without becoming a complete account of the calculation. Preserve enough source information to reconstruct the comparison that was actually made.

When revising an explanation, keep the old and new rule fields available. A changed allowance can legitimately be part of a deliberate experiment with a proposed comparison policy, but it should be described as a rule change. It should not be reported as improved source data or a better model output. Review the same supplied cases under each named rule, keep unresolved inputs unresolved under both and identify any later evaluation needed before applying the proposal to real work.

Review the explanation in the order the decision depends on it

Start with the source quantities and confirm that the compared fields have matching roles. A total should not be compared with a rate merely because both are numerical. Confirm the units and the mapping between records. Then identify the exact rule, including whether its boundary is inclusive. Only after those relationships are established should you inspect the arithmetic and summarize the result. This order helps prevent a correct calculation from concealing a wrong comparison.

Next, separate representation issues from tolerance choices. A displayed value may have been rounded, while the calculation used an underlying value with more digits. An exported decimal string may have been converted to a floating-point number. A missing field may have been substituted. Those transformations can affect the comparison inputs, but they are not themselves reasons to choose a tolerance. Keep a source-preserving copy and identify the transformation actually applied before explaining a discrepancy.

An effective AI request can ask for an explanation of a supplied comparison rather than a verdict on whether a system is good enough. Provide the values, units, explicit tolerances and intended comparison formula. Ask for the difference, allowance and result, followed by unresolved questions. Review the reply against those fields. If the assistant introduces a default, changes the denominator or replaces a missing value, correct the task representation before relying on the conclusion.

For a final note, use language that matches the evidence: the authored pair passes the declared finite comparison, the absolute allowance controls this example, or the full-list result remains unresolved. Avoid upgrading a numerical predicate into a claim of interchangeable records, equivalent meaning or operational acceptance. A clear boundary does not make the comparison less useful. It makes it possible for another reader to see what was calculated and which separate decision still requires evidence.

Keep that final note alongside the unchanged fictional inputs so that a later reader can reproduce the stated comparison.

Frequently asked questions

Does passing a tolerance mean two values are exactly equal?

No. Case A has a nonzero difference of one while passing its declared relative comparison. Preserve the original values and state the actual rule. Exact equality, rounded display equality and numerical closeness are separate relationships. None alone establishes that two source records, meanings or operational outcomes are interchangeable.

Should I always use the relative tolerance supplied by a library default?

A default is a software setting, not evidence that it fits a particular task. Identify the requirement and the reason for the chosen allowance. This guide recommends no universal threshold and does not evaluate real measurements or production outputs. Its fictional tolerances are supplied inputs used to explain the arithmetic.

Why can a comparison with zero fail despite a small-looking difference?

Under the declared relative-only rule, the allowance follows the input magnitude. Case C's difference of 0.001 exceeds its relative allowance of 0.00001. Adding a separately declared absolute allowance changes that comparison. Whether such an allowance belongs in a real task requires justification beyond the numerical result.

What happens to an absolute tolerance when minutes become seconds?

It must be converted consistently with the values. Case D converts 0.02 minutes into 1.2 seconds and preserves the passing comparison. Carrying the bare number into seconds instead creates a different allowance. The case is authored arithmetic, not an observed duration, instrument assessment or operational acceptance finding.

Can I merge every record connected by passing pairwise comparisons?

The pairwise rule alone does not define a justified grouping policy. Case E has two passing neighboring pairs but failing endpoints. Define the group's required property and representative-selection rule separately, and preserve source identifiers. No actual clustering, duplicate assessment, record merge or identity determination is performed here.

How should I report a list with an unknown comparison value?

Report the completed comparisons and their denominator, then preserve the unresolved full-list result. In case F, two completed pairs pass while only two of three pairs have supplied inputs. The two hypothetical third values illustrate possible outcomes; they do not complete the actual list or establish general evaluation performance.

Original fictional practice data

Original fictional teaching cases, not actual client records, reservations, model outputs, professional review or operating approval. No executable utility is supplied.

Six original fictional teaching cases; definitions and scope remain in the guide
fictional caseauthored inputsbounded result
A{"a": "100", "b": "101", "relative": "1/100", "absolute": "0"}Difference1;relative allowance101/100;closeness true;exact equality false
B{"pairs": [["10", "11"], ["1000", "1001"]], "relative": "1/100", "absoluteOnly": "1"}Equal differences1;relative resultsfalse/true;absolute-only resultsbothtrue at inclusive boundary
C{"a": "0", "b": "1/1000", "relative": "1/100", "absoluteChoices": ["0", "1/1000"]}Relativeallowance1/100000 fail;absolute1/1000 pass
D{"minutes": ["3", "301/100"], "absoluteMinutes": "1/50", "secondsPerMinute": 60}Minute difference1/100 pass;seconds180/903over5 difference3/5 allowance6/5 pass;bare1/50seconds fail
E{"values": ["0", "9/10", "9/5"], "relative": "0", "absolute": "1"}Neighborpairsbothpass;endpointsfail;not transitiveidentity/grouping
F{"pairs": [["10", "10"], ["20", "21"], ["30", null]], "absolute": "1", "hypotheticalThird": ["30", "32"]}2/2completedpass;2/3available;fullunresolved;hypothetical3/3or2/3

Primary sources and editorial scope

AI-assisted website editorial. Sources read October 29, 2026 America/New_York. Original fictional teaching inputs and planning records only; no actual ticket, reservation, visit, inquiry, artwork/material observation, experiment, route inspection, individual access assessment, professional review or institutional endorsement. Original examples checked independently. No record change, actual client dataset, observed model output, professional review, security certification or operating approval is asserted.

Related practical questions