Skip to content

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented May 11, 2025

@serhiy-storchaka
Copy link
Member Author

This is a further development of #13741.

@vstinner
Copy link
Member

A PEP is being written for this module: skirpichev/peps#8

@vstinner

This comment was marked as resolved.

itamaro

This comment was marked as resolved.

skirpichev

This comment was marked as resolved.

Comment on lines 12 to 13
These functions accept integers and objects that implement the
:meth:`~object.__index__` method which is used to convert the object to an integer
Copy link
Contributor

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.

@corona10

This comment was marked as resolved.

@skirpichev

This comment was marked as resolved.

@skirpichev skirpichev self-requested a review May 13, 2025 12:39
@skirpichev

This comment was marked as resolved.

@skirpichev skirpichev changed the title gh-81313: Add the imath module gh-81313: Add the intmath module Jun 1, 2025
@picnixz picnixz changed the title gh-81313: Add the intmath module gh-81313: Add the intmath module (PEP-791) Jun 1, 2025
Comment on lines +14 to +15
number. They cannot be used with floating-point numbers or complex
numbers.
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Return factorial of the nonnegative integer *n*.


.. function:: gcd(a, b)
Copy link
Member

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.. function:: gcd(a, b)
.. function:: gcd(*integers)

Comment on lines +89 to +90
This module provides access to the mathematical functions for integer arguments.
(Contributed by Serhiy Storchaka in :gh:`81313`.)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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`.)

@skirpichev skirpichev self-requested a review September 14, 2025 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants