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

Implement Rational#coerce with Complex object #5001

Merged
merged 2 commits into from
Jan 23, 2018

Conversation

yui-knk
Copy link
Contributor

@yui-knk yui-knk commented Jan 23, 2018

In MRI

  • if the argument is complex with zero imaginary part,
    converts it to ratinal
  • if the argument is complex with non-zero imaginary part,
    converts self to complex

Ref: https://github.com/ruby/ruby/blob/v2_3_0/rational.c#L1171

In MRI

* if the argument is complex with zero imaginary part,
  converts it to ratinal
* if the argument is complex with non-zero imaginary part,
  converts self to complex

Ref: https://github.com/ruby/ruby/blob/v2_3_0/rational.c#L1171
@kares
Copy link
Member

kares commented Jan 23, 2018

🥇 👍 ... but maybe its better to target master (9.2) with these - not sure? (unless of course there's bugs)
have been doing cleanup/(internal) refactoring around Numerics lately and some pieces might not merge 📗

on the other hand I am happy to handle these merges we'll need to sync up about the plan for 9.1 as it didn't merge over in a while and it won't go clean with latest de-dup commits on both sides // @headius @enebo

@enebo
Copy link
Member

enebo commented Jan 23, 2018

@kares I think this is fine. He is reference 2.3.0 behavior in the MRI link and it removes an issue in MRI test excludes.

@enebo
Copy link
Member

enebo commented Jan 23, 2018

@kares merging is a problem but I suspect this one will not be very difficult to know where it fits?

@enebo enebo added this to the JRuby 9.1.16.0 milestone Jan 23, 2018
@enebo enebo added the core label Jan 23, 2018
@enebo enebo merged commit ba67802 into jruby:jruby-9.1 Jan 23, 2018
@yui-knk yui-knk deleted the rational_coerce_with_complex branch January 23, 2018 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants