]> Cypherpunks repositories - gostls13.git/commit
math/big: add (*Int).Sqrt
authorRuss Cox <rsc@golang.org>
Mon, 10 Oct 2016 20:18:43 +0000 (16:18 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 17 Oct 2016 20:30:19 +0000 (20:30 +0000)
commit9ee21f90d2594412dd60dd821831056db708fa53
treee32f8c06166eceacb6666802822d48dea73bc135
parent2190f771d876180fe3fe51d785f0dbc32a5373d0
math/big: add (*Int).Sqrt

This is needed for some of the more complex primality tests
(to filter out exact squares), and while the code is simple the
boundary conditions are not obvious, so it seems worth having
in the library.

Change-Id: Ica994a6b6c1e412a6f6d9c3cf823f9b653c6bcbd
Reviewed-on: https://go-review.googlesource.com/30706
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/math/big/int.go
src/math/big/int_test.go
src/math/big/nat.go