aboutsummaryrefslogtreecommitdiff
path: root/lib/std/fmt/parse_float.zig
diff options
context:
space:
mode:
authorMarc Tiehuis <marc@tiehu.is>2025-06-08 14:32:16 +1200
committerAndrew Kelley <andrew@ziglang.org>2025-06-08 17:57:37 -0400
commitcffa98eef54568bf43cbbe14a3cbbf972a2c7a7a (patch)
tree805c9325a460680e752d469fe04337026221d73a /lib/std/fmt/parse_float.zig
parent201c0f54a597a53d04c782687c903cd5ea177066 (diff)
downloadzig-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.zig3
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" {