-
-
Notifications
You must be signed in to change notification settings - Fork 33.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.
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 <[email protected]>
Co-authored-by: Sergey B Kirpichev <[email protected]>
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) |
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/