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 String#to_f(whitespace: false) work with infinity and NaN #13875

Merged

Conversation

HertzDevil
Copy link
Contributor

"Infinity".to_f64?(whitespace: false) would previously return nil and to_f64 would raise, due to an incorrect optimization.

@HertzDevil HertzDevil added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:numeric topic:stdlib:text labels Oct 9, 2023
@straight-shoota straight-shoota added this to the 1.11.0 milestone Oct 9, 2023
@straight-shoota straight-shoota merged commit 955f7a7 into crystal-lang:master Oct 17, 2023
47 checks passed
@HertzDevil HertzDevil deleted the bug/string-to_f-inf-nan branch October 26, 2023 12:59
Blacksmoke16 pushed a commit to Blacksmoke16/crystal that referenced this pull request Dec 11, 2023
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.

2 participants