]> Cypherpunks repositories - gostls13.git/commitdiff
math/big, math/rand: use the built-in max function
authorchanxuehong <chanxuehong@gmail.com>
Thu, 17 Aug 2023 01:58:22 +0000 (01:58 +0000)
committerGopher Robot <gobot@golang.org>
Thu, 17 Aug 2023 16:42:19 +0000 (16:42 +0000)
Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
GitHub-Last-Rev: 8da43b2cbd563ed123690709e519c9f84272b332
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>
src/math/big/nat.go
src/math/rand/rand_test.go

index 90ce6d19c41399c2cf28b5ee33ce918b8797fae0..b9f4026a04dc0b9c59f7ab67c41e04c99a3749e0 100644 (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
index 7eba1dc0d3256a14de2366e604b1dc7c9d5fe313..4ad2ae2230f28e43c42bb875a6614c615c17ae8b 100644 (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.