8000 gh-131094: Refine math.isclose docs · guyjacoby/cpython@a83f755 · GitHub
[go: up one dir, main page]

Skip to content

Commit a83f755

Browse files
authored
pythongh-131094: Refine math.isclose docs
Corrected the statement about any *x* and *rel_tol* always producing ``False`` to exclude ``x = 0``.
1 parent 155c44b commit a83f755

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/math.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ Floating point manipulation functions
350350

351351
*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be
352352
nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed
353-
as ``abs(x) <= rel_tol * abs(x)``, which is ``False`` for any ``x`` and
354-
rel_tol less than ``1.0``. So add an appropriate positive abs_tol argument
353+
as ``abs(x) <= rel_tol * abs(x)``, which is ``False`` for any nonzero ``x`` and
354+
*rel_tol* less than ``1.0``. So add an appropriate positive *abs_tol* argument
355355
to the call.
356356

357357
The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be

0 commit comments

Comments
 (0)
0