Commit 7be32d03 authored by Robert Griesemer's avatar Robert Griesemer

math/big: reenable TestFloatAdd32 (used to fail on 32bit platforms)

Change-Id: I932c2f1b1d27c437722cd27d2001b085a655c572
Reviewed-on: https://go-review.googlesource.com/6722Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
parent 2a1728d0
...@@ -261,34 +261,34 @@ func (z *Float) SetMantExp(mant *Float, exp int) *Float { ...@@ -261,34 +261,34 @@ func (z *Float) SetMantExp(mant *Float, exp int) *Float {
} }
// IsNeg reports whether x is negative. // IsNeg reports whether x is negative.
// A NaN is not negative. // A NaN value is not negative.
func (x *Float) IsNeg() bool { func (x *Float) IsNeg() bool {
return x.neg && x.exp != nanExp return x.neg && x.exp != nanExp
} }
// IsZero reports whether x is a +0 or -0. // IsZero reports whether x is +0 or -0.
func (x *Float) IsZero() bool { func (x *Float) IsZero() bool {
return len(x.mant) == 0 && x.exp == 0 return len(x.mant) == 0 && x.exp == 0
} }
// IsFinite reports whether -Inf < x < Inf. // IsFinite reports whether -Inf < x < Inf.
// A NaN is not finite. // A NaN value is not finite.
func (x *Float) IsFinite() bool { func (x *Float) IsFinite() bool {
return len(x.mant) != 0 || x.exp == 0 return len(x.mant) != 0 || x.exp == 0
} }
// IsInf reports whether x is a +Inf or -Inf. // IsInf reports whether x is +Inf or -Inf.
func (x *Float) IsInf() bool { func (x *Float) IsInf() bool {
return x.exp == infExp return x.exp == infExp
} }
// IsNaN reports whether x is a NaN. // IsNaN reports whether x is a NaN value.
func (x *Float) IsNaN() bool { func (x *Float) IsNaN() bool {
return x.exp == nanExp return x.exp == nanExp
} }
// IsInt reports whether x is an integer. // IsInt reports whether x is an integer.
// ±Inf and NaN are not considered integers. // ±Inf and NaN values are not integers.
func (x *Float) IsInt() bool { func (x *Float) IsInt() bool {
if debugFloat { if debugFloat {
validate(x) validate(x)
......
...@@ -1058,11 +1058,6 @@ func TestFloatAdd(t *testing.T) { ...@@ -1058,11 +1058,6 @@ func TestFloatAdd(t *testing.T) {
// TestFloatAdd32 tests that Float.Add/Sub of numbers with // TestFloatAdd32 tests that Float.Add/Sub of numbers with
// 24bit mantissa behaves like float32 addition/subtraction. // 24bit mantissa behaves like float32 addition/subtraction.
func TestFloatAdd32(t *testing.T) { func TestFloatAdd32(t *testing.T) {
// TODO(gri) fix test for 32bit platforms
if _W == 32 {
return
}
// chose base such that we cross the mantissa precision limit // chose base such that we cross the mantissa precision limit
const base = 1<<26 - 0x10 // 11...110000 (26 bits) const base = 1<<26 - 0x10 // 11...110000 (26 bits)
for d := 0; d <= 0x10; d++ { for d := 0; d <= 0x10; d++ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment