diff options
| author | Lewis Gaul <lewis.gaul@gmail.com> | 2024-05-25 23:05:20 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-07-17 05:04:59 +0200 |
| commit | 03dfd2ecc37cc99b15d4ce3ff19147230ddc8fd4 (patch) | |
| tree | 884eb9f9b59110715ca4618393ee2369dcec2cb2 /lib/compiler_rt/exp.zig | |
| parent | 7abb170f59ed959c4004ec37258c8905903f36b1 (diff) | |
| download | zig-03dfd2ecc37cc99b15d4ce3ff19147230ddc8fd4.tar.gz zig-03dfd2ecc37cc99b15d4ce3ff19147230ddc8fd4.zip | |
Make sure to test the sign of the zero results
Diffstat (limited to 'lib/compiler_rt/exp.zig')
| -rw-r--r-- | lib/compiler_rt/exp.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compiler_rt/exp.zig b/lib/compiler_rt/exp.zig index 55b784770b..fa4356a336 100644 --- a/lib/compiler_rt/exp.zig +++ b/lib/compiler_rt/exp.zig @@ -218,7 +218,7 @@ test "expf() special" { try expectEqual(expf(1.0), math.e); try expectEqual(expf(math.ln2), 2.0); try expectEqual(expf(math.inf(f32)), math.inf(f32)); - try expectEqual(expf(-math.inf(f32)), 0.0); + try expect(math.isPositiveZero(expf(-math.inf(f32)))); try expect(math.isNan(expf(math.nan(f32)))); try expect(math.isNan(expf(math.snan(f32)))); } @@ -268,7 +268,7 @@ test "exp() special" { // try expectEqual(exp(1.0), math.e); try expectEqual(exp(math.ln2), 2.0); try expectEqual(exp(math.inf(f64)), math.inf(f64)); - try expectEqual(exp(-math.inf(f64)), 0.0); + try expect(math.isPositiveZero(exp(-math.inf(f64)))); try expect(math.isNan(exp(math.nan(f64)))); try expect(math.isNan(exp(math.snan(f64)))); } |
