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: 3464ee7ec1d9
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0c00708c4f42
Choose a head ref
  • 4 commits
  • 2 files changed
  • 2 contributors

Commits on Jan 31, 2018

  1. Define Numeric#%

    Currently `Numeric#%` is defined in the same way
    as `Numeric#modulo`.
    
    Ref: https://github.com/ruby/ruby/blob/v2_4_0/numeric.c#L5240-L5241
    yui-knk committed Jan 31, 2018
    Copy the full SHA
    94baf98 View commit details
  2. Remove Rational#modulo and Rational#%

    Currently these methods are not defined on `Rational`.
    yui-knk committed Jan 31, 2018
    Copy the full SHA
    6961c3a View commit details
  3. Remove Rational#div

    Currently this method is not defined on `Rational`.
    yui-knk committed Jan 31, 2018
    Copy the full SHA
    b3e4efe View commit details
  4. Merge pull request #5022 from yui-knk/fix_test_coerce2_master

    Fix test coerce2 for master branch
    
    since merge of #5006 wasn't handled properly due changes in RubyRational.java
    kares authored Jan 31, 2018
    Copy the full SHA
    0c00708 View commit details
Showing with 1 addition and 9 deletions.
  1. +1 −1 core/src/main/java/org/jruby/RubyNumeric.java
  2. +0 −8 core/src/main/java/org/jruby/RubyRational.java
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyNumeric.java
Original file line number Diff line number Diff line change
@@ -799,7 +799,7 @@ public IRubyObject fdiv(ThreadContext context, IRubyObject other) {
/** num_modulo
*
*/
@JRubyMethod(name = "modulo")
@JRubyMethod(name = {"modulo", "%"})
public IRubyObject modulo(ThreadContext context, IRubyObject other) {
IRubyObject div = numFuncall(context, this, sites(context).div, other);
IRubyObject product = sites(context).op_times.call(context, other, other, div);
8 changes: 0 additions & 8 deletions core/src/main/java/org/jruby/RubyRational.java
Original file line number Diff line number Diff line change
@@ -818,21 +818,13 @@ public IRubyObject op_coerce(ThreadContext context, IRubyObject other) {
throw runtime.newTypeError(other.getMetaClass() + " can't be coerced into " + getMetaClass());
}

/** nurat_idiv
*
*/
@JRubyMethod(name = "div")
@Override
public IRubyObject idiv(ThreadContext context, IRubyObject other) {
if (num2dbl(other) == 0.0) throw context.runtime.newZeroDivisionError();

return f_floor(context, f_div(context, this, other));
}

/** nurat_mod
*
*/
@JRubyMethod(name = {"modulo", "%"})
public IRubyObject op_mod(ThreadContext context, IRubyObject other) {
if (num2dbl(other) == 0.0) throw context.runtime.newZeroDivisionError();