aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler_rt/exp2.zig
diff options
context:
space:
mode:
authorLewis Gaul <lewis.gaul@gmail.com>2024-05-25 23:05:20 +0100
committerAndrew Kelley <andrew@ziglang.org>2025-07-17 05:04:59 +0200
commit03dfd2ecc37cc99b15d4ce3ff19147230ddc8fd4 (patch)
tree884eb9f9b59110715ca4618393ee2369dcec2cb2 /lib/compiler_rt/exp2.zig
parent7abb170f59ed959c4004ec37258c8905903f36b1 (diff)
downloadzig-03dfd2ecc37cc99b15d4ce3ff19147230ddc8fd4.tar.gz
zig-03dfd2ecc37cc99b15d4ce3ff19147230ddc8fd4.zip
Make sure to test the sign of the zero results
Diffstat (limited to 'lib/compiler_rt/exp2.zig')
-rw-r--r--lib/compiler_rt/exp2.zig4
1 files changed, 2 insertions, 2 deletions
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))));
}