-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-81313: Add the intmath module (PEP-791) #133909
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
This is a further development of #13741. |
A PEP is being written for this module: skirpichev/peps#8 |
This comment was marked as resolved.
This comment was marked as resolved.
Doc/library/imath.rst
Outdated
These functions accept integers and objects that implement the | ||
:meth:`~object.__index__` method which is used to convert the object to an integer |
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.
In the same way we could simplify now description of argument processing in the math module. Except for a special snowflake "log" - all use PyFloat_AsDouble(). (Well, few functions also try special dunder methods.)
Though, probably it's for following prs.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
number. They cannot be used with floating-point numbers or complex | ||
numbers. |
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.
Last sentence looks redundant, though maybe it worth to be here.
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
expression (1 + x)**n. | ||
|
||
Raises ValueError if either of the arguments are negative. | ||
|
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.
Return factorial of the nonnegative integer *n*. | ||
|
||
|
||
.. function:: gcd(a, b) |
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.
Isn't it gcd(*integers)
?
Return factorial of the nonnegative integer *n*. | ||
|
||
|
||
.. function:: gcd(a, b) |
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:: gcd(a, b) | |
.. function:: gcd(*integers) |
@@ -83,7 +83,11 @@ Other language changes | |||
New modules | |||
=========== | |||
|
|||
* None yet. | |||
intmath |
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.
Maybe add an entry under the PEP-sized items as well?
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.
Not all PEP's mentioned in release Summary (e.g. PEP 757 for the 3.13).
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.
Yes, but for 3.14, I think we're mentioning them all? @hugovk do you want to mention the PEP? Or at least, we should have a link to the PEP. There is none at the moment (annotationlib
got one)
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.
Ask me after the PEP has been accepted :)
This module provides access to the mathematical functions for integer arguments. | ||
(Contributed by Serhiy Storchaka in :gh:`81313`.) |
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.
This module provides access to the mathematical functions for integer arguments. | |
(Contributed by Serhiy Storchaka in :gh:`81313`.) | |
This module provides access to the mathematical functions for integer | |
arguments (:pep:`791`). | |
(Contributed by Serhiy Storchaka in :gh:`81313`.) |
📚 Documentation preview 📚: https://cpython-previews--133909.org.readthedocs.build/