diff options
Diffstat (limited to 'src/math/all_test.go')
| -rw-r--r-- | src/math/all_test.go | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/math/all_test.go b/src/math/all_test.go index a37bf8a2be..886267bc17 100644 --- a/src/math/all_test.go +++ b/src/math/all_test.go @@ -2094,33 +2094,6 @@ var sqrt32 = []float32{ -5.0106036182710749e+00, } -type compareTest[F float32 | float64] struct { - x, y F - want int -} - -func compareCases[F float32 | float64]() []compareTest[F] { - zero, nan, inf := F(0.0), F(NaN()), F(Inf(0)) - return []compareTest[F]{ - {-nan, -inf, -1}, - {-inf, -nan, 1}, - {-inf, -Pi, -1}, - {-Pi, -inf, 1}, - {-Pi, -zero, -1}, - {-zero, -Pi, 1}, - {-zero, 0, -1}, - {0, -zero, 1}, - {0, Pi, -1}, - {Pi, 0, 1}, - {Pi, inf, -1}, - {inf, Pi, 1}, - {inf, nan, -1}, - {nan, inf, 1}, - {Pi, Pi, 0}, - {-nan, -nan, 0}, - } -} - func tolerance(a, b, e float64) bool { // Multiplying by e here can underflow denormal values to zero. // Check a==b so that at least if a and b are small and identical @@ -2288,22 +2261,6 @@ func TestCeil(t *testing.T) { } } -func TestCompare(t *testing.T) { - // -NaN < -∞ < -3.14 < -0 < 0 < 3.14 < ∞ < NaN - for _, c := range compareCases[float64]() { - cmp := Compare(c.x, c.y) - if cmp != c.want { - t.Errorf("Compare(%v, %v) = %d, want %v", c.x, c.y, cmp, c.want) - } - } - for _, c := range compareCases[float32]() { - cmp := Compare32(c.x, c.y) - if cmp != c.want { - t.Errorf("Compare32(%v, %v) = %d, want %v", c.x, c.y, cmp, c.want) - } - } -} - func TestCopysign(t *testing.T) { for i := 0; i < len(vf); i++ { if f := Copysign(vf[i], -1); copysign[i] != f { @@ -3363,22 +3320,6 @@ func BenchmarkCeil(b *testing.B) { GlobalF = x } -func BenchmarkCompare(b *testing.B) { - x := 0 - for i := 0; i < b.N; i++ { - x = Compare(1.5, 2.5) - } - GlobalI = x -} - -func BenchmarkCompare32(b *testing.B) { - x := 0 - for i := 0; i < b.N; i++ { - x = Compare32(1.5, 2.5) - } - GlobalI = x -} - var copysignNeg = -1.0 func BenchmarkCopysign(b *testing.B) { |
