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

Make sprintf and String#% ignore NaN sign bit #12400

Merged

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Aug 17, 2022

Fixes #12382.

This actually implements %f and friends in String::Formatter itself so that NaNs and infinities do not use LibC.snprintf.

Note that BigFloats are not supported yet, and even if they were, they are always finite unless #11410 is implemented.

@HertzDevil HertzDevil added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:numeric topic:stdlib:text labels Aug 17, 2022
@straight-shoota straight-shoota added this to the 1.6.0 milestone Aug 17, 2022
@straight-shoota straight-shoota merged commit a47a89a into crystal-lang:master Aug 19, 2022
@HertzDevil HertzDevil deleted the bug/sprintf-nan-sign branch August 28, 2022 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:numeric topic:stdlib:text
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NAN constants have different signs on compiler versus interpreter
2 participants