From 03dfd2ecc37cc99b15d4ce3ff19147230ddc8fd4 Mon Sep 17 00:00:00 2001 From: Lewis Gaul Date: Sat, 25 May 2024 23:05:20 +0100 Subject: Make sure to test the sign of the zero results --- lib/compiler_rt/exp2.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/compiler_rt/exp2.zig') diff --git a/lib/compiler_rt/exp2.zig b/lib/compiler_rt/exp2.zig index e27bae8092..ce79dff497 100644 --- a/lib/compiler_rt/exp2.zig +++ b/lib/compiler_rt/exp2.zig @@ -464,7 +464,7 @@ test "exp2f() special" { try expectEqual(exp2f(1.0), 2.0); try expectEqual(exp2f(-1.0), 0.5); try expectEqual(exp2f(math.inf(f32)), math.inf(f32)); - try expectEqual(exp2f(-math.inf(f32)), 0.0); + try expect(math.isPositiveZero(exp2f(-math.inf(f32)))); try expect(math.isNan(exp2f(math.nan(f32)))); try expect(math.isNan(exp2f(math.snan(f32)))); } @@ -502,7 +502,7 @@ test "exp2() special" { try expectEqual(exp2(1.0), 2.0); try expectEqual(exp2(-1.0), 0.5); try expectEqual(exp2(math.inf(f64)), math.inf(f64)); - try expectEqual(exp2(-math.inf(f64)), 0.0); + try expect(math.isPositiveZero(exp2(-math.inf(f64)))); try expect(math.isNan(exp2(math.nan(f64)))); try expect(math.isNan(exp2(math.snan(f64)))); } -- cgit v1.2.3