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

Clarify behaviour of unsafe Float-to-number conversions #10631

Merged

Conversation

HertzDevil
Copy link
Contributor

Closes #10629.

Float-to-float overflow is defined by LLVM; fptrunc "is assumed to execute in the default floating-point environment", which will produce infinities, in contrast to Float-to-integers that return a poison value.

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. kind:docs topic:stdlib:numeric labels Apr 13, 2021
@straight-shoota straight-shoota added this to the 1.1.0 milestone Jun 9, 2021
@straight-shoota straight-shoota merged commit f866a5a into crystal-lang:master Jun 13, 2021
@HertzDevil HertzDevil deleted the doc/float-to_i-unsafe branch June 13, 2021 20:08
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. kind:docs topic:stdlib:numeric
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Float#to_u! is broken on overflow values
3 participants