-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[std.fmt] Added parsing support for f80 #20462
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good.
Can you remove this (no longer needed) check here for float round-tripping? then I will trigger the CI:
zig/lib/std/fmt/format_float.zig
Line 1524 in cb308ba
if (@bitSizeOf(T) != 80) { |
.max_exponent_fast_path_disguised = 46, | ||
.max_mantissa_fast_path = 2 << std.math.floatMantissaBits(T), | ||
// Slow + Eisel-Lemire | ||
.mantissa_explicit_bits = std.math.floatFractionalBits(T), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is clearer if we change the other float types to use floatFractionalBits
instead of floatMantissaBits
as done here. The value is the same for the other IEEE types.
@@ -72,8 +77,6 @@ pub fn isEightDigits(v: u64) bool { | |||
} | |||
|
|||
pub fn isDigit(c: u8, comptime base: u8) bool { | |||
std.debug.assert(base == 10 or base == 16); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this?
Resolves: #19263
Test plan:
zig test lib/std/fmt/parse_float.zig
passes locally with additional f80 unit tests