diff options
| author | Marc Tiehuis <marc@tiehu.is> | 2025-06-08 14:32:16 +1200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-06-08 17:57:37 -0400 |
| commit | cffa98eef54568bf43cbbe14a3cbbf972a2c7a7a (patch) | |
| tree | 805c9325a460680e752d469fe04337026221d73a /lib/std/fmt/parse_float.zig | |
| parent | 201c0f54a597a53d04c782687c903cd5ea177066 (diff) | |
| download | zig-cffa98eef54568bf43cbbe14a3cbbf972a2c7a7a.tar.gz zig-cffa98eef54568bf43cbbe14a3cbbf972a2c7a7a.zip | |
std.fmt.parseFloat: fix hex-float negative inf
Closes #24111.
Diffstat (limited to 'lib/std/fmt/parse_float.zig')
| -rw-r--r-- | lib/std/fmt/parse_float.zig | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/std/fmt/parse_float.zig b/lib/std/fmt/parse_float.zig index cb47faee8d..8b46986bae 100644 --- a/lib/std/fmt/parse_float.zig +++ b/lib/std/fmt/parse_float.zig @@ -159,6 +159,9 @@ test "hex.special" { try testing.expect(math.isPositiveInf(try parseFloat(f32, "iNf"))); try testing.expect(math.isPositiveInf(try parseFloat(f32, "+Inf"))); try testing.expect(math.isNegativeInf(try parseFloat(f32, "-iNf"))); + + try testing.expect(math.isPositiveInf(try parseFloat(f32, "0x9999p9999"))); + try testing.expect(math.isNegativeInf(try parseFloat(f32, "-0x9999p9999"))); } test "hex.zero" { |
