From bd2e46c8255fad4e75e589b3286ead560e910b39 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 3 Oct 2012 05:27:36 +0000 Subject: libgo: Update to Go 1.0.3. From-SVN: r192025 --- libgo/go/math/all_test.go | 11 +++++++++++ libgo/go/math/big/nat.go | 2 +- libgo/go/math/bits.go | 2 +- libgo/go/math/remainder.go | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) (limited to 'libgo/go/math') 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. -- cgit v1.1