Skip to content
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.float.parseFloat: fix large hex-float parsing #20287

Merged
merged 1 commit into from
Jun 15, 2024

Conversation

tiehuis
Copy link
Member

@tiehuis tiehuis commented Jun 14, 2024

There were two primary issues at play here:

  1. The hex float prefix was not handled correctly when the stream was reset for the fallback parsing path, which occured when the mantissa was longer max mantissa digits.
  2. The implied exponent was not adjusted for hex-floats in this branch.

Additionally, some of the float parsing routines have been condensed, making use of comptime.

closes #20275.

There were two primary issues at play here:
 1. The hex float prefix was not handled correctly when the stream was
    reset for the fallback parsing path, which occured when the mantissa was
    longer max mantissa digits.
 2. The implied exponent was not adjusted for hex-floats in this branch.

Additionally, some of the float parsing routines have been condensed, making
use of comptime.

closes ziglang#20275
@tiehuis tiehuis force-pushed the fix-hex-many-digits-bug branch from ce5b7fe to 6bc3fbd Compare June 14, 2024 01:25
Copy link
Member

@ifreund ifreund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@ifreund ifreund merged commit 1b728e1 into ziglang:master Jun 15, 2024
10 checks passed
@MasonRemaley
Copy link
Contributor

Nice, thanks for the fix 🙂

@tiehuis tiehuis deleted the fix-hex-many-digits-bug branch June 19, 2024 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible float parsing bug
3 participants