Skip to content

proposal: math: integer square root #59861

@chiyoi

Description

@chiyoi

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions