Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Rounding mode support for hexadecimal float parsing, with improvements to error handling #529

Merged
merged 10 commits into from
Apr 15, 2025

Conversation

quaternic
Copy link
Contributor

Parsing errors are now bubbled up part of the way, but that needs some more work.

Rounding should be correct, and the Status returned by parse_any should have the correct bits set. These are used for the current (unchanged) behaviour of the surface level functions like hf64: panic on invalid inputs, or values that aren't exactly representable.

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Sorry I disappeared for a bit soon after you posted this, but it looks great! Just one possible doc fix.

@quaternic quaternic force-pushed the hex-parse-rounding branch from 06ea7d2 to d551777 Compare April 13, 2025 11:25
@quaternic
Copy link
Contributor Author

quaternic commented Apr 13, 2025

@tgross35

Sorry I disappeared for a bit soon after you posted this, but it looks great! Just one possible doc fix.

Thanks! I'm sorry for taking my time as well. I fixed the comment and rebased; and CI seems to still be happy with it. Could you squash this while merging?

@quaternic quaternic changed the title Rounding mode support for hexadecimal float parsing, with (WIP) improvements to error handling Rounding mode support for hexadecimal float parsing, with improvements to error handling Apr 13, 2025
@CrazyboyQCD
Copy link

There are some magic numbers and literals, it would be good to make them constants for better readability.

@tgross35 tgross35 enabled auto-merge (squash) April 15, 2025 00:13
@tgross35 tgross35 disabled auto-merge April 15, 2025 00:14
@tgross35 tgross35 enabled auto-merge (squash) April 15, 2025 00:15
@tgross35 tgross35 merged commit 3020d64 into rust-lang:master Apr 15, 2025
35 checks passed
@quaternic quaternic deleted the hex-parse-rounding branch April 15, 2025 01:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants