Skip to content

gh-90345: Add math.integer.isqrt_rem()#150224

Open
skirpichev wants to merge 10 commits into
python:mainfrom
skirpichev:add-isqrt_rem/90345
Open

gh-90345: Add math.integer.isqrt_rem()#150224
skirpichev wants to merge 10 commits into
python:mainfrom
skirpichev:add-isqrt_rem/90345

Conversation

@skirpichev
Copy link
Copy Markdown
Member

@skirpichev skirpichev commented May 22, 2026

@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 22, 2026

Comment thread Modules/mathintegermodule.c
Comment thread Modules/mathintegermodule.c Outdated
skirpichev and others added 3 commits May 23, 2026 04:50
@skirpichev skirpichev requested a review from picnixz May 23, 2026 02:29
Comment thread Doc/library/math.integer.rst Outdated
Comment on lines +67 to +68
Return a pair of values (s,t) such that s=isqrt(n) and t=n-s*s.
The remainder *t* will be zero, if *n* is a perfect square.
Copy link
Copy Markdown
Member

@picnixz picnixz May 23, 2026

Choose a reason for hiding this comment

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

Suggested change
Return a pair of values (s,t) such that s=isqrt(n) and t=n-s*s.
The remainder *t* will be zero, if *n* is a perfect square.
For a nonnegative integer *n*, return the pair of integers *(s, t)*
such that ``s = isqrt(n)`` and ``t = n - s*s``.
The remainder *t* is zero, if *n* is a perfect square.

This is where I wish we could have mathjax.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added with minor change (tuple formatted as verbatim).

Comment thread Lib/test/test_math_integer.py
Comment thread Lib/test/test_math_integer.py
Comment thread Modules/mathintegermodule.c
Comment thread Modules/mathintegermodule.c Outdated
Comment thread Modules/mathintegermodule.c Outdated
@skirpichev skirpichev requested a review from picnixz May 24, 2026 01:57
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.

2 participants