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

Fix power of 0 and 1 issues in Rational #2616

Merged
merged 1 commit into from May 1, 2015

Conversation

@lumeet
Copy link
Contributor

@lumeet lumeet commented Feb 23, 2015

The patch adds special case handling for 0**n and 1**n to match the
MRI behavior. For example, the following cases are affected:

0**Rational(1, 2) # => 0/1 instead of 0.0
0**Rational(-1, 2) # => ZeroDivisionError instead of Infinity`
1**Rational(1, 2) # => 1/1 instead of 1.0
The patch adds special case handling for 0**n and 1**n to match the
MRI behavior. For example, the following cases are affected:

0**Rational(1, 2) # => 0/1 instead of 0.0
0**Rational(-1, 2) # => ZeroDivisionError instead of Infinity
1**Rational(1, 2) # => 1/1 instead of 1.0
@enebo enebo added this to the JRuby 9.0.0.0.rc1 milestone May 1, 2015
enebo added a commit that referenced this issue May 1, 2015
Fix power of 0 and 1 issues in Rational
@enebo enebo merged commit 446f058 into jruby:master May 1, 2015
1 check passed
@lumeet lumeet deleted the rational_zero_division branch May 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants