-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
gh-137871: Clarify cmath.nan documentation by linking to math module #137876
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
Conversation
The documentation for `cmath.nan` and `cmath.inf` is updated to cross-reference the equivalent constants in the `math` module. The `math` module's documentation contains a more thorough explanation of the properties of these special floating-point values, as required by the IEEE 754 standard (e.g., that NaN does not compare equal to itself).
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
@AzizCode92, next time you can combine several suggestions on tab "Files Changed". |
Sure |
Do we not want to do this? |
No. Sorry for that suggestion. This just add link with a same info. |
| ``float('nan')``. | ||
|
|
||
| See also :data:`math.nan`. | ||
|
|
There was a problem hiding this comment.
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.
| ``float('nan')``. | |
| See also :data:`math.nan`. | |
| :data:`math.nan`. | |
There was a problem hiding this comment.
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.)
|
@terryjreedy Is there anything missing I should do here to merge this PR? |
Signed-off-by: AzizCode92 <azizbenothman76@gmail.com>
|
Thanks @AzizCode92 for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…odule (pythonGH-137876) (cherry picked from commit 025b403) Co-authored-by: Aziz <azizbenothman76@gmail.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
…odule (pythonGH-137876) (cherry picked from commit 025b403) Co-authored-by: Aziz <azizbenothman76@gmail.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
GH-140095 is a backport of this pull request to the 3.14 branch. |
|
GH-140096 is a backport of this pull request to the 3.13 branch. |
The documentation for
cmath.nanis updated to cross-reference the equivalent constants in themathmodule.The
mathmodule's documentation contains a more thorough explanation of the properties of these special floating-point values, as required by the IEEE 754 standard (e.g., that NaN does not compare equal to itself).cmath.nandocs: Equivalent tofloat('nan')#137871📚 Documentation preview 📚: https://cpython-previews--137876.org.readthedocs.build/en/137876/library/cmath.html#cmath.nan