Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaokang2022 committed Nov 3, 2024
1 parent b9f37e8 commit 90baab0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Doc/library/cmath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ 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 absolute tolerance; it defaults to ``0.0`` and it must be nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed as ``abs(x) <= rel_tol * abs(x)``, which is false for any ``x`` and rel_tol less than ``1.0``. So add an appropriate positive abs_tol argument to the call.
*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be
nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed
as ``abs(x) <= rel_tol * abs(x)``, which is false for any ``x`` and rel_tol
less than ``1.0``. So add an appropriate positive abs_tol argument to the
call.

If no errors occur, the result will be:
``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``.
Expand Down
8 changes: 5 additions & 3 deletions Doc/library/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,11 @@ 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 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``.
*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be
nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed
as ``abs(x) <= rel_tol * abs(x)``, which is false for any ``x`` and rel_tol
less than ``1.0``. So add an appropriate positive abs_tol argument to the
call.

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

0 comments on commit 90baab0

Please sign in to comment.