Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2245c4faccb9
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3a91f9e7d35c
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 6, 2017

  1. Copy the full SHA
    285f60a View commit details
  2. Copy the full SHA
    3a91f9e View commit details
Showing with 2 additions and 4 deletions.
  1. +1 −1 core/src/main/java/org/jruby/RubyBignum.java
  2. +1 −3 core/src/main/java/org/jruby/RubyRational.java
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyBignum.java
Original file line number Diff line number Diff line change
@@ -590,7 +590,7 @@ public final IRubyObject op_pow(final ThreadContext context, final long other) {
return RubyFloat.newFloat(context.runtime, Math.pow(big2dbl(this), (double) other));
}
// (other < 0)
return RubyRational.newRationalRaw(context.runtime, this).callMethod(context, "**", RubyFixnum.newFixnum(context.runtime, other));
return RubyRational.newRationalRaw(context.runtime, this).op_expt(context, other);
}

private void warnIfPowExponentTooBig(final ThreadContext context, final long other) {
4 changes: 1 addition & 3 deletions core/src/main/java/org/jruby/RubyRational.java
Original file line number Diff line number Diff line change
@@ -622,9 +622,7 @@ public IRubyObject op_expt(ThreadContext context, IRubyObject other) {
f_odd_p(context, other) ? RubyFixnum.minus_one(runtime) : RubyFixnum.one(runtime));
}
if (f_zero_p(context, num)) {
if (f_cmp(context, other, RubyFixnum.zero(runtime)) == RubyFixnum.minus_one(runtime)) {
throw context.runtime.newZeroDivisionError();
}
if (f_negative_p(context, other)) throw context.runtime.newZeroDivisionError();
return RubyRational.newRationalBang(context, getMetaClass(), RubyFixnum.zero(runtime));
}
}