Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-126165: Improve docs of function math.isclose #126215

Merged
merged 15 commits into from
Nov 4, 2024
5 changes: 3 additions & 2 deletions Doc/library/cmath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ Classification functions
tolerance is ``1e-09``, which assures that the two values are the same
within about 9 decimal digits. *rel_tol* must be greater than zero.

*abs_tol* is the minimum absolute tolerance -- useful for comparisons near
zero. *abs_tol* must be at least zero.
*abs_tol* is the absolute tolerance; it must be nonnegative. Only ``0.0``
is close to ``0.0`` per default. Pass an appropriate absolute tolerance to
compare with ``0.0``.
terryjreedy marked this conversation as resolved.
Show resolved Hide resolved

If no errors occur, the result will be:
``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``.
Expand Down
5 changes: 3 additions & 2 deletions Doc/library/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ Number-theoretic and representation functions
tolerance is ``1e-09``, which assures that the two values are the same
within about 9 decimal digits. *rel_tol* must be greater than zero.

*abs_tol* is the minimum absolute tolerance -- useful for comparisons near
zero. *abs_tol* must be at least zero.
*abs_tol* is the absolute tolerance; it must be nonnegative. Only ``0.0``
is close to ``0.0`` per default. Pass an appropriate absolute tolerance to
compare with ``0.0``.

If no errors occur, the result will be:
``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``.
Expand Down
Loading