diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-10-03 05:27:36 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-10-03 05:27:36 +0000 |
commit | bd2e46c8255fad4e75e589b3286ead560e910b39 (patch) | |
tree | 4f194bdb2e9edcc69ef2ab0dfb4aab15ca259267 /libgo/go/math | |
parent | bed6238ce677ba18a672a58bc077cec6de47f8d3 (diff) | |
download | gcc-bd2e46c8255fad4e75e589b3286ead560e910b39.zip gcc-bd2e46c8255fad4e75e589b3286ead560e910b39.tar.gz gcc-bd2e46c8255fad4e75e589b3286ead560e910b39.tar.bz2 |
libgo: Update to Go 1.0.3.
From-SVN: r192025
Diffstat (limited to 'libgo/go/math')
-rw-r--r-- | libgo/go/math/all_test.go | 11 | ||||
-rw-r--r-- | libgo/go/math/big/nat.go | 2 | ||||
-rw-r--r-- | libgo/go/math/bits.go | 2 | ||||
-rw-r--r-- | libgo/go/math/remainder.go | 2 |
4 files changed, 14 insertions, 3 deletions
diff --git a/libgo/go/math/all_test.go b/libgo/go/math/all_test.go index ed66a42..35c33ce 100644 --- a/libgo/go/math/all_test.go +++ b/libgo/go/math/all_test.go @@ -1693,6 +1693,17 @@ func alike(a, b float64) bool { return false } +func TestNaN(t *testing.T) { + f64 := NaN() + if f64 == f64 { + t.Fatalf("NaN() returns %g, expected NaN", f64) + } + f32 := float32(f64) + if f32 == f32 { + t.Fatalf("float32(NaN()) is %g, expected NaN", f32) + } +} + func TestAcos(t *testing.T) { for i := 0; i < len(vf); i++ { a := vf[i] / 10 diff --git a/libgo/go/math/big/nat.go b/libgo/go/math/big/nat.go index eaa6ff06..6d81823 100644 --- a/libgo/go/math/big/nat.go +++ b/libgo/go/math/big/nat.go @@ -396,7 +396,7 @@ func (z nat) mul(x, y nat) nat { } // use basic multiplication if the numbers are small - if n < karatsubaThreshold || n < 2 { + if n < karatsubaThreshold { z = z.make(m + n) basicMul(z, x, y) return z.norm() diff --git a/libgo/go/math/bits.go b/libgo/go/math/bits.go index 1cf60ce..0df0b1c 100644 --- a/libgo/go/math/bits.go +++ b/libgo/go/math/bits.go @@ -5,7 +5,7 @@ package math const ( - uvnan = 0x7FF0000000000001 + uvnan = 0x7FF8000000000001 uvinf = 0x7FF0000000000000 uvneginf = 0xFFF0000000000000 mask = 0x7FF diff --git a/libgo/go/math/remainder.go b/libgo/go/math/remainder.go index a233e8e..98bb04d 100644 --- a/libgo/go/math/remainder.go +++ b/libgo/go/math/remainder.go @@ -4,7 +4,7 @@ package math -// The original C code and the the comment below are from +// The original C code and the comment below are from // FreeBSD's /usr/src/lib/msun/src/e_remainder.c and came // with this notice. The go code is a simplified version of // the original C. |