math/big, math/rand: use the built-in max function

Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
GitHub-Last-Rev: 8da43b2cbd
GitHub-Pull-Request: golang/go#61955
Reviewed-on: https://go-review.googlesource.com/c/go/+/518595
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
This commit is contained in:
chanxuehong 2023-08-17 01:58:22 +00:00 committed by Gopher Robot
parent 36fc721419
commit aaa384cf3a
2 changed files with 0 additions and 14 deletions

View File

@ -389,13 +389,6 @@ func addAt(z, x nat, i int) {
}
}
func max(x, y int) int {
if x > y {
return x
}
return y
}
// karatsubaLen computes an approximation to the maximum k <= n such that
// k = p<<i for a number p <= threshold and an i >= 0. Thus, the
// result is the largest number that can be divided repeatedly by 2 before

View File

@ -33,13 +33,6 @@ type statsResults struct {
maxError float64
}
func max(a, b float64) float64 {
if a > b {
return a
}
return b
}
func nearEqual(a, b, closeEnough, maxError float64) bool {
absDiff := math.Abs(a - b)
if absDiff < closeEnough { // Necessary when one value is zero and one value is close to zero.