Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Doc/library/cmath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ Constants
A floating-point "not a number" (NaN) value. Equivalent to
``float('nan')``.

See also :data:`math.nan`.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmath.nan is more equivalent to math.nan than float('nan') in being a fixed data object, with a fixed id, rather than a function which can return different objects with different ids when called multiple times.

Suggested change
``float('nan')``.
See also :data:`math.nan`.
:data:`math.nan`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's better. Link just show you same statement of "equivalency". Better just inline it here. In all respect it's "an equivalency", i.e. all nan's in Python are same in sense that we don't have separated signaling/quiet nans and they don't have payload. (Or, in some sense, we don't have simple user interface to this stuff.)

(BTW, I think you suggestion is off by one whitespace.)

.. versionadded:: 3.6


Expand Down
Loading