Make sure to test the sign of the zero results
This commit is contained in:
committed by
Andrew Kelley
parent
7abb170f59
commit
03dfd2ecc3
@@ -288,8 +288,8 @@ fn expm1_64(x_: f64) f64 {
|
||||
}
|
||||
|
||||
test "expm1_32() special" {
|
||||
try expectEqual(expm1_32(0.0), 0.0);
|
||||
try expectEqual(expm1_32(-0.0), 0.0);
|
||||
try expect(math.isPositiveZero(expm1_32(0.0)));
|
||||
try expect(math.isNegativeZero(expm1_32(-0.0)));
|
||||
try expectEqual(expm1_32(math.ln2), 1.0);
|
||||
try expectEqual(expm1_32(math.inf(f32)), math.inf(f32));
|
||||
try expectEqual(expm1_32(-math.inf(f32)), -1.0);
|
||||
@@ -326,8 +326,8 @@ test "expm1_32() boundary" {
|
||||
}
|
||||
|
||||
test "expm1_64() special" {
|
||||
try expectEqual(expm1_64(0.0), 0.0);
|
||||
try expectEqual(expm1_64(-0.0), 0.0);
|
||||
try expect(math.isPositiveZero(expm1_64(0.0)));
|
||||
try expect(math.isNegativeZero(expm1_64(-0.0)));
|
||||
try expectEqual(expm1_64(math.ln2), 1.0);
|
||||
try expectEqual(expm1_64(math.inf(f64)), math.inf(f64));
|
||||
try expectEqual(expm1_64(-math.inf(f64)), -1.0);
|
||||
|
||||
@@ -184,8 +184,8 @@ fn log1p_64(x: f64) f64 {
|
||||
}
|
||||
|
||||
test "log1p_32() special" {
|
||||
try expectEqual(log1p_32(0.0), 0.0);
|
||||
try expectEqual(log1p_32(-0.0), 0.0);
|
||||
try expect(math.isPositiveZero(log1p_32(0.0)));
|
||||
try expect(math.isNegativeZero(log1p_32(-0.0)));
|
||||
try expectEqual(log1p_32(-1.0), -math.inf(f32));
|
||||
try expectEqual(log1p_32(1.0), math.ln2);
|
||||
try expectEqual(log1p_32(math.inf(f32)), math.inf(f32));
|
||||
@@ -219,8 +219,8 @@ test "log1p_32() boundary" {
|
||||
}
|
||||
|
||||
test "log1p_64() special" {
|
||||
try expectEqual(log1p_64(0.0), 0.0);
|
||||
try expectEqual(log1p_64(-0.0), 0.0);
|
||||
try expect(math.isPositiveZero(log1p_64(0.0)));
|
||||
try expect(math.isNegativeZero(log1p_64(-0.0)));
|
||||
try expectEqual(log1p_64(-1.0), -math.inf(f64));
|
||||
try expectEqual(log1p_64(1.0), math.ln2);
|
||||
try expectEqual(log1p_64(math.inf(f64)), math.inf(f64));
|
||||
|
||||
Reference in New Issue
Block a user