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

Float to_i should raise a FloatDomainError when NaN #646

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

stevegeek
Copy link
Contributor

@stevegeek stevegeek commented Oct 13, 2022

Float to_i should raise a FloatDomainError when NaN

There is no test for this in the to_i example in spec/core . I added one and will then try upstream it to ruby/spec

I notice that the change recommended for the stack allocated Float has been fixed by a similar commit so did not include it

It was:

auto significand = Value::floatingpoint(std::frexp(arg, &exponent));
Value x = significand.send(env, "*"_s, { y })->as_float()->to_i(env);

vs what is now in master

@stevegeek stevegeek force-pushed the master branch 2 times, most recently from 6152920 to 629c190 Compare October 13, 2022 10:24
@seven1m seven1m merged commit 0b45a10 into natalie-lang:master Oct 13, 2022
@stevegeek
Copy link
Contributor Author

Also opened ruby/spec#958

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants