Skip to content

bpo-36887: add math.isqrt#13244

Merged
mdickinson merged 17 commits intopython:masterfrom
mdickinson:math-isqrt
May 18, 2019
Merged

bpo-36887: add math.isqrt#13244
mdickinson merged 17 commits intopython:masterfrom
mdickinson:math-isqrt

Conversation

@mdickinson
Copy link
Copy Markdown
Member

@mdickinson mdickinson commented May 11, 2019

Add an integer square root function to the math module.

https://bugs.python.org/issue36887

Comment thread Modules/mathmodule.c Outdated
Comment thread Modules/mathmodule.c Outdated
Comment thread Modules/mathmodule.c Outdated
Comment thread Modules/mathmodule.c Outdated
Comment thread Doc/library/math.rst Outdated
Comment thread Modules/mathmodule.c Outdated
Comment thread Modules/mathmodule.c Outdated
Comment thread Modules/mathmodule.c Outdated
Comment thread Modules/mathmodule.c
Comment thread Modules/mathmodule.c
Comment thread Modules/mathmodule.c Outdated
Comment thread Doc/library/math.rst Outdated
Comment thread Modules/mathmodule.c
Comment thread Modules/mathmodule.c Outdated
- clarify that floats are rejected even if they happen to be
  squares of small integers
- TypeError beats ValueError for a negative float
Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM. I did not analyze the original formulas, but the C code looks correct.

I left just few minor suggestions to the documentation. You can ignore them.

Comment thread Doc/library/math.rst Outdated
Comment thread Doc/library/math.rst Outdated
@serhiy-storchaka
Copy link
Copy Markdown
Member

I added suggestions to add \ , but I just checked that this is not needed. Ignore these comments.

@mdickinson mdickinson merged commit 73934b9 into python:master May 18, 2019
@mdickinson mdickinson deleted the math-isqrt branch May 18, 2019 11:30
@mdickinson
Copy link
Copy Markdown
Member Author

Merged. @serhiy-storchaka: many thanks for the thorough review!

@mdickinson mdickinson added the type-feature A feature request or enhancement label May 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants