-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-135853: add math.fmax
and math.fmin
#135888
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
base: main
Are you sure you want to change the base?
Conversation
math.fmax
and math.fmin
math.fmax
and math.fmin
[PoC]
0831229
to
afb0a91
Compare
math.fmax
and math.fmin
[PoC]math.fmax
and math.fmin
Misc/NEWS.d/next/Library/2025-06-24-13-30-47.gh-issue-135853.7ejTvK.rst
Outdated
Show resolved
Hide resolved
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.
LGTM
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
@@ -247,6 +249,30 @@ Floating point arithmetic | |||
.. versionadded:: 3.13 | |||
|
|||
|
|||
.. function:: fmax(x, y, /) |
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.
.. function:: fmax(x, y, /) | |
.. function:: fmax(x, y) |
Lets not introduce this syntax, unless it's used in other functions of the module docs.
.. versionadded:: next | ||
|
||
|
||
.. function:: fmin(x, y, /) |
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.
.. function:: fmin(x, y, /) | |
.. function:: fmin(x, y) |
I've added
math.fmin
andmath.fmax
as I think it'd be nice to have the NaN handling as per C99. I didn't make those functions generic or accept any iterable argument.WDYT of this proposal @skirpichev @rhettinger?
math
#135853📚 Documentation preview 📚: https://cpython-previews--135888.org.readthedocs.build/