Skip to content
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

proposal: math: integer square root #59861

Closed
chiyoi opened this issue Apr 27, 2023 · 1 comment
Closed

proposal: math: integer square root #59861

chiyoi opened this issue Apr 27, 2023 · 1 comment

Comments

@chiyoi
Copy link

chiyoi commented Apr 27, 2023

Add a function like math.Isqrt(n int) int.

Currently I implement this by

sort.Search(n, func(x int) bool { return x * x + 2 * x + 1 > n })

but maybe this feature could be added to the standard library like math.Ilogb

@gopherbot gopherbot added this to the Proposal milestone Apr 27, 2023
@seankhliao
Copy link
Member

our bar for what might be added to math was clarified here #58146 (comment)

c math.h doesn't have this.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2023
@golang golang locked and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants