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

Projects
None yet
2 participants
@lumeet
Copy link
Contributor

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
Fix power of 0 and 1 issues in Rational
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 pull request May 1, 2015

Merge pull request #2616 from lumeet/rational_zero_division
Fix power of 0 and 1 issues in Rational

@enebo enebo merged commit 446f058 into jruby:master May 1, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@lumeet lumeet deleted the lumeet: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
You can’t perform that action at this time.