← TechnologyThe essentials of

Math.isclose: nearby numbers under an explicit tolerance

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 16:11 · Updated: 22 Oct 2026 16:11

AI source check: 22 Oct 2026 14:04. This is not editorial approval.

In a few sentences

In brief

math.isclose() compares numbers using relative and absolute tolerances. For example, math.isclose(0.1 + 0.2, 0.3) is True under the default settings.

Useful to know

math.isclose() compares numbers using relative and absolute tolerances. For example, math.isclose(0.1 + 0.2, 0.3) is True under the default settings. [1]

That is not a universal rule for every measurement. A suitable abs_tol is often important near zero. Choose acceptable deviation according to the units and task rather than using approximate equality to hide an arbitrary error.

Sources

For further detail and to check the information:

  1. [1] math — Mathematical functions — Python 3.12.15 documentation ↗