~ubuntu-branches/ubuntu/saucy/golang/saucy

« back to all changes in this revision

Viewing changes to src/pkg/math/all_test.go

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2013-07-08 05:52:37 UTC
  • mfrom: (29.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20130708055237-at01839e0hp8z3ni
Tags: 2:1.1-1ubuntu1
016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1128
1128
        NaN(),
1129
1129
}
1130
1130
var gammaSC = []float64{
 
1131
        NaN(),
 
1132
        NaN(),
1131
1133
        Inf(-1),
1132
1134
        Inf(1),
1133
1135
        Inf(1),
1134
 
        Inf(1),
1135
 
        Inf(1),
1136
1136
        NaN(),
1137
1137
}
1138
1138
 
1693
1693
        return false
1694
1694
}
1695
1695
 
 
1696
func TestNaN(t *testing.T) {
 
1697
        f64 := NaN()
 
1698
        if f64 == f64 {
 
1699
                t.Fatalf("NaN() returns %g, expected NaN", f64)
 
1700
        }
 
1701
        f32 := float32(f64)
 
1702
        if f32 == f32 {
 
1703
                t.Fatalf("float32(NaN()) is %g, expected NaN", f32)
 
1704
        }
 
1705
}
 
1706
 
1696
1707
func TestAcos(t *testing.T) {
1697
1708
        for i := 0; i < len(vf); i++ {
1698
1709
                a := vf[i] / 10
2270
2281
                        t.Errorf("Log2(%g) = %g, want %g", vflogSC[i], f, logSC[i])
2271
2282
                }
2272
2283
        }
 
2284
        for i := -1074; i <= 1023; i++ {
 
2285
                f := Ldexp(1, i)
 
2286
                l := Log2(f)
 
2287
                if l != float64(i) {
 
2288
                        t.Errorf("Log2(2**%d) = %g, want %d", i, l, i)
 
2289
                }
 
2290
        }
2273
2291
}
2274
2292
 
2275
2293
func TestModf(t *testing.T) {