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

Add Float::Primitive.parse_hexfloat, .parse_hexfloat?, #to_hexfloat #14027

Merged
merged 5 commits into from
Dec 7, 2023

Conversation

HertzDevil
Copy link
Contributor

Resolves #14021.

Most of the code was adapted from my previous shard implementation to ensure it conforms to the IEEE standard.

For printing, this is not enough for sprintf "%a", because things like precision and alternate format aren't available yet. For parsing, the whitespace and strict parameters can be added later, as they don't interfere with the contents within a hexfloat, only with the surrounding characters.

@straight-shoota straight-shoota added this to the 1.11.0 milestone Dec 6, 2023
@straight-shoota straight-shoota merged commit 413f2fd into crystal-lang:master Dec 7, 2023
50 of 55 checks passed
@HertzDevil HertzDevil deleted the feature/hexfloat branch December 7, 2023 11:05
Blacksmoke16 pushed a commit to Blacksmoke16/crystal that referenced this pull request Dec 11, 2023
…oat` (crystal-lang#14027)

Co-authored-by: Johannes Müller <straightshoota@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IEEE 754 hexadecimal floating-point string conversions
2 participants