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/std/math/expm1.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/std/math/expm1.zig')
| -rw-r--r-- | lib/std/math/expm1.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/math/expm1.zig b/lib/std/math/expm1.zig index 048bd57cba..7c57459271 100644 --- a/lib/std/math/expm1.zig +++ b/lib/std/math/expm1.zig @@ -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); |
