mirror of https://github.com/golang/go.git
math/big, math/rand: use the built-in max function
This commit is contained in:
parent
14a3ffc3d2
commit
8da43b2cbd
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue