@@ -244,19 +244,21 @@ Number-theoretic and representation functions
244
244
``False `` otherwise.
245
245
246
246
Whether or not two values are considered close is determined according to
247
- given absolute and relative tolerances.
247
+ given absolute and relative tolerances. If no errors occur, the result will
248
+ be: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol) ``.
248
249
249
250
*rel_tol * is the relative tolerance -- it is the maximum allowed difference
250
251
between *a * and *b *, relative to the larger absolute value of *a * or *b *.
251
252
For example, to set a tolerance of 5%, pass ``rel_tol=0.05 ``. The default
252
253
tolerance is ``1e-09 ``, which assures that the two values are the same
253
- within about 9 decimal digits. *rel_tol * must be greater than zero.
254
-
255
- *abs_tol * is the minimum absolute tolerance -- useful for comparisons near
256
- zero. *abs_tol * must be at least zero.
257
-
258
- If no errors occur, the result will be:
259
- ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol) ``.
254
+ within about 9 decimal digits. *rel_tol * must be nonnegative and less
255
+ than ``1.0 ``.
256
+
257
+ *abs_tol * is the absolute tolerance; it defaults to ``0.0 `` and it must be
258
+ nonnegative. When comparing ``x `` to ``0.0 ``, ``isclose(x, 0) `` is computed
259
+ as ``abs(x) <= rel_tol * abs(x) ``, which is ``False `` for any ``x `` and
260
+ rel_tol less than ``1.0 ``. So add an appropriate positive abs_tol argument
261
+ to the call.
260
262
261
263
The IEEE 754 special values of ``NaN ``, ``inf ``, and ``-inf `` will be
262
264
handled according to IEEE rules. Specifically, ``NaN `` is not considered
0 commit comments