Skip to content

Commit

Permalink
Showing 7 changed files with 623 additions and 230 deletions.
24 changes: 23 additions & 1 deletion core/src/main/java/org/jruby/RubyBignum.java
Original file line number Diff line number Diff line change
@@ -90,7 +90,11 @@ public static RubyBignum newBignum(Ruby runtime, long value) {
}

public static RubyBignum newBignum(Ruby runtime, double value) {
return newBignum(runtime, new BigDecimal(value).toBigInteger());
try {
return newBignum(runtime, new BigDecimal(value).toBigInteger());
} catch (NumberFormatException nfe) {
throw runtime.newFloatDomainError(Double.toString(value));
}
}

public static RubyBignum newBignum(Ruby runtime, BigInteger value) {
@@ -1065,6 +1069,24 @@ public IRubyObject fdivFloat(ThreadContext context, RubyFloat y) {
return context.runtime.newFloat(new BigDecimal(value).divide(new BigDecimal(y.getValue())).doubleValue());
}

@Override
public IRubyObject isNegative(ThreadContext context) {
Ruby runtime = context.runtime;
if (sites(context).basic_op_lt.retrieveCache(metaClass).method.isBuiltin()) {
return runtime.newBoolean(value.signum() < 0);
}
return sites(context).basic_op_lt.call(context, this, this, RubyFixnum.zero(runtime));
}

@Override
public IRubyObject isPositive(ThreadContext context) {
Ruby runtime = context.runtime;
if (sites(context).basic_op_gt.retrieveCache(metaClass).method.isBuiltin()) {
return runtime.newBoolean(value.signum() > 0);
}
return sites(context).basic_op_gt.call(context, this, this, RubyFixnum.zero(runtime));
}

private static JavaSites.BignumSites sites(ThreadContext context) {
return context.sites.Bignum;
}
18 changes: 18 additions & 0 deletions core/src/main/java/org/jruby/RubyFixnum.java
Original file line number Diff line number Diff line change
@@ -1318,6 +1318,24 @@ public IRubyObject fdivDouble(ThreadContext context, IRubyObject y) {
}
}

@Override
public IRubyObject isNegative(ThreadContext context) {
Ruby runtime = context.runtime;
if (sites(context).basic_op_lt.retrieveCache(metaClass).method.isBuiltin()) {
return runtime.newBoolean(value < 0);
}
return sites(context).basic_op_lt.call(context, this, this, RubyFixnum.zero(runtime));
}

@Override
public IRubyObject isPositive(ThreadContext context) {
Ruby runtime = context.runtime;
if (sites(context).basic_op_gt.retrieveCache(metaClass).method.isBuiltin()) {
return runtime.newBoolean(value > 0);
}
return sites(context).basic_op_gt.call(context, this, this, RubyFixnum.zero(runtime));
}

private static JavaSites.FixnumSites sites(ThreadContext context) {
return context.sites.Fixnum;
}
329 changes: 213 additions & 116 deletions core/src/main/java/org/jruby/RubyFloat.java

Large diffs are not rendered by default.

49 changes: 35 additions & 14 deletions core/src/main/java/org/jruby/RubyInteger.java
Original file line number Diff line number Diff line change
@@ -408,23 +408,23 @@ public IRubyObject to_i() {
}

@JRubyMethod(name = "ceil")
public IRubyObject ceil(){
public IRubyObject ceil(ThreadContext context){
return this;
}

@JRubyMethod(name = "ceil", required = 1)
public abstract IRubyObject ceil(ThreadContext context, IRubyObject arg);

@JRubyMethod(name = "floor")
public IRubyObject floor(){
public IRubyObject floor(ThreadContext context){
return this;
}

@JRubyMethod(name = "floor", required = 1)
public abstract IRubyObject floor(ThreadContext context, IRubyObject arg);

@JRubyMethod(name = "truncate")
public IRubyObject truncate(){
public IRubyObject truncate(ThreadContext context){
return this;
}

@@ -433,15 +433,10 @@ public IRubyObject truncate(){

@Override
@JRubyMethod(name = "round")
public IRubyObject round() {
public IRubyObject round(ThreadContext context) {
return this;
}

@Deprecated
public final IRubyObject round19() {
return round();
}

@JRubyMethod(name = "round")
public IRubyObject round(ThreadContext context, IRubyObject arg) {
int ndigits = RubyNumeric.num2int(arg);
@@ -480,11 +475,6 @@ public IRubyObject round(ThreadContext context, IRubyObject arg) {
}
}

@Deprecated
public final IRubyObject round19(ThreadContext context, IRubyObject arg) {
return round(context, arg);
}

/** integer_to_r
*
*/
@@ -608,6 +598,7 @@ public IRubyObject denominator(ThreadContext context) {
@JRubyMethod(name = "*")
public abstract IRubyObject op_mul(ThreadContext context, IRubyObject other);

// MRI: rb_int_idiv, polymorphism handles fixnum vs bignum
@JRubyMethod(name = "div")
public abstract IRubyObject op_idiv(ThreadContext context, IRubyObject other);

@@ -736,4 +727,34 @@ public static IRubyObject induced_from(ThreadContext context, IRubyObject recv,
"failed to convert " + other.getMetaClass().getName() + " into Integer");
}
}

@Deprecated
public IRubyObject round() {
return this;
}

@Deprecated
public IRubyObject ceil(){
return this;
}

@Deprecated
public IRubyObject floor(){
return this;
}

@Deprecated
public IRubyObject truncate(){
return this;
}

@Deprecated
public final IRubyObject round19() {
return round(getRuntime().getCurrentContext());
}

@Deprecated
public final IRubyObject round19(ThreadContext context, IRubyObject arg) {
return round(context, arg);
}
}
135 changes: 101 additions & 34 deletions core/src/main/java/org/jruby/RubyNumeric.java
Original file line number Diff line number Diff line change
@@ -55,6 +55,7 @@
import org.jruby.util.TypeConverter;

import java.math.BigInteger;
import java.math.RoundingMode;

import static org.jruby.RubyEnumerator.SizeFn;
import static org.jruby.RubyEnumerator.enumeratorizeWithSize;
@@ -117,6 +118,27 @@ public RubyNumeric(Ruby runtime, RubyClass metaClass, boolean useObjectSpace, bo
super(runtime, metaClass, useObjectSpace, canBeTainted);
}

public static RoundingMode getRoundingMode(ThreadContext context, IRubyObject opts) {
IRubyObject halfArg = ArgsUtil.extractKeywordArg(context, "half", opts);

if (halfArg.isNil()) {
return RoundingMode.HALF_UP;
} else if (halfArg instanceof RubySymbol) {
String halfString = halfArg.toString();

switch (halfString) {
case "up":
return RoundingMode.HALF_UP;
case "even":
return RoundingMode.HALF_EVEN;
case "down":
return RoundingMode.HALF_DOWN;
}
}

throw context.runtime.newArgumentError("invalid rounding mode: " + halfArg);
}

// The implementations of these are all bonus (see TODO above) I was going
// to throw an error from these, but it appears to be the wrong place to
// do it.
@@ -240,6 +262,16 @@ public static IRubyObject dbl2num(Ruby runtime, double val) {
return convertToNum(val, runtime);
}

/**
* MRI: dbl2ival
*/
public static IRubyObject dbl2ival(Ruby runtime, double val) {
if (fixable(val)) {
return RubyFixnum.newFixnum(runtime, (long) val);
}
return RubyBignum.newBignum(runtime, val);
}

/** rb_num2dbl and NUM2DBL
*
*/
@@ -749,11 +781,6 @@ public IRubyObject div(ThreadContext context, IRubyObject other) {
return sites(context).floor.call(context, quotient, quotient);
}

@Deprecated
public final IRubyObject div19(ThreadContext context, IRubyObject other) {
return div(context, other);
}

/** num_divmod
*
*/
@@ -762,11 +789,6 @@ public IRubyObject divmod(ThreadContext context, IRubyObject other) {
return RubyArray.newArray(context.runtime, div(context, other), modulo(context, other));
}

@Deprecated
public final IRubyObject divmod19(ThreadContext context, IRubyObject other) {
return divmod(context, other);
}

/** num_fdiv */
@JRubyMethod(name = "fdiv")
public IRubyObject fdiv(ThreadContext context, IRubyObject other) {
@@ -784,14 +806,6 @@ public IRubyObject modulo(ThreadContext context, IRubyObject other) {
return sites(context).op_minus.call(context, this, this, product);
}

/** num_modulo
*
*/
@Deprecated
public final IRubyObject modulo19(ThreadContext context, IRubyObject other) {
return modulo(context, other);
}

/** num_remainder
*
*/
@@ -873,36 +887,36 @@ public IRubyObject nonzero_p(ThreadContext context) {
return this;
}

/** num_floor
*
/**
* MRI: num_floor
*/
@JRubyMethod(name = "floor")
public IRubyObject floor() {
return convertToFloat().floor();
public IRubyObject floor(ThreadContext context) {
return convertToFloat().floor(context);
}

/** num_ceil
*
/**
* MRI: num_ceil
*/
@JRubyMethod(name = "ceil")
public IRubyObject ceil() {
return convertToFloat().ceil();
public IRubyObject ceil(ThreadContext context) {
return convertToFloat().ceil(context);
}

/** num_round
*
/**
* MRI: num_round
*/
@JRubyMethod(name = "round")
public IRubyObject round() {
return convertToFloat().round();
public IRubyObject round(ThreadContext context) {
return convertToFloat().round(context);
}

/** num_truncate
*
/**
* MRI: num_truncate
*/
@JRubyMethod(name = "truncate")
public IRubyObject truncate() {
return convertToFloat().truncate();
public IRubyObject truncate(ThreadContext context) {
return convertToFloat().truncate(context);
}

// TODO: Fold kwargs into the @JRubyMethod decorator
@@ -1358,6 +1372,21 @@ public static IRubyObject numFuncall(ThreadContext context, final IRubyObject x,
return context.safeRecurse(new NumFuncall1(value), site, x, site.methodName, true);
}

// MRI: macro FIXABLE, RB_FIXABLE
public static boolean fixable(double f) {
return posFixable(f) && negFixable(f);
}

// MRI: macro POSFIXABLE, RB_POSFIXABLE
public static boolean posFixable(double f) {
return f < RubyFixnum.MAX + 1;
}

// MRI: macro NEGFIXABLE, RB_NEGFIXABLE
public static boolean negFixable(double f) {
return f >= RubyFixnum.MIN;
}

private static class NumFuncall1 implements ThreadContext.RecursiveFunctionEx<CallSite> {
private final IRubyObject value;

@@ -1396,6 +1425,29 @@ public IRubyObject call(ThreadContext context, CallSite site, IRubyObject obj, b
}
}

@Deprecated
public IRubyObject floor() {
return floor(getRuntime().getCurrentContext());
}

@Deprecated
public IRubyObject ceil() {
return ceil(getRuntime().getCurrentContext());
}

@Deprecated
public IRubyObject round() {
return round(getRuntime().getCurrentContext());
}

/** num_truncate
*
*/
@Deprecated
public IRubyObject truncate() {
return truncate(getRuntime().getCurrentContext());
}

private static JavaSites.NumericSites sites(ThreadContext context) {
return context.sites.Numeric;
}
@@ -1404,4 +1456,19 @@ private static JavaSites.NumericSites sites(ThreadContext context) {
public static RubyFloat str2fnum19(Ruby runtime, RubyString arg, boolean strict) {
return str2fnum(runtime, arg, strict);
}

@Deprecated
public final IRubyObject div19(ThreadContext context, IRubyObject other) {
return div(context, other);
}

@Deprecated
public final IRubyObject divmod19(ThreadContext context, IRubyObject other) {
return divmod(context, other);
}

@Deprecated
public final IRubyObject modulo19(ThreadContext context, IRubyObject other) {
return modulo(context, other);
}
}
294 changes: 229 additions & 65 deletions core/src/main/java/org/jruby/RubyRational.java
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@
***** END LICENSE BLOCK *****/
package org.jruby;

import static org.jruby.util.Numeric.checkInteger;
import static org.jruby.util.Numeric.f_abs;
import static org.jruby.util.Numeric.f_add;
import static org.jruby.util.Numeric.f_cmp;
@@ -37,7 +36,6 @@
import static org.jruby.util.Numeric.f_idiv;
import static org.jruby.util.Numeric.f_inspect;
import static org.jruby.util.Numeric.f_integer_p;
import static org.jruby.util.Numeric.f_lt_p;
import static org.jruby.util.Numeric.f_minus_one_p;
import static org.jruby.util.Numeric.f_mul;
import static org.jruby.util.Numeric.f_negate;
@@ -62,13 +60,14 @@
import static org.jruby.util.Numeric.nurat_rationalize_internal;

import java.io.IOException;
import java.math.RoundingMode;

import org.jcodings.specific.ASCIIEncoding;
import org.jruby.anno.JRubyClass;
import org.jruby.anno.JRubyMethod;
import org.jruby.ast.util.ArgsUtil;
import org.jruby.common.IRubyWarnings;
import org.jruby.runtime.Arity;
import org.jruby.runtime.Block;
import org.jruby.runtime.ClassIndex;
import org.jruby.runtime.JavaSites;
import org.jruby.runtime.ObjectAllocator;
@@ -124,8 +123,8 @@ public IRubyObject allocate(Ruby runtime, RubyClass klass) {
*/
private RubyRational(Ruby runtime, IRubyObject clazz, IRubyObject num, IRubyObject den) {
super(runtime, (RubyClass)clazz);
this.num = num;
this.den = den;
this.num = num.convertToInteger();
this.den = den.convertToInteger();
}

/** rb_rational_raw
@@ -197,8 +196,8 @@ public ClassIndex getNativeClassIndex() {
return ClassIndex.RATIONAL;
}

private IRubyObject num;
private IRubyObject den;
private RubyInteger num;
private RubyInteger den;

/** nurat_canonicalization
*
@@ -812,91 +811,236 @@ public IRubyObject op_abs(ThreadContext context) {
return f_negate(context, this);
}

private IRubyObject op_roundCommonPre(ThreadContext context, IRubyObject n) {
checkInteger(context, n);
Ruby runtime = context.runtime;
return f_expt(context, RubyFixnum.newFixnum(runtime, 10), n);
}

private IRubyObject op_roundCommonPost(ThreadContext context, IRubyObject s, IRubyObject n, IRubyObject b) {
s = f_div(context, newRationalBang(context, getMetaClass(), s), b);
if (f_lt_p(context, n, RubyFixnum.one(context.runtime)).isTrue()) s = f_to_i(context, s);
return s;
}

/** nurat_floor
*
/**
* MRI: nurat_floor_n
*/
@JRubyMethod(name = "floor")
public IRubyObject op_floor(ThreadContext context) {
return f_idiv(context, num, den);
public IRubyObject floor(ThreadContext context) {
return roundCommon(context, context.nil, RoundingMode.FLOOR);
}

@JRubyMethod(name = "floor")
public IRubyObject op_floor(ThreadContext context, IRubyObject n) {
IRubyObject b = op_roundCommonPre(context, n);
return op_roundCommonPost(context, ((RubyRational)f_mul(context, this, b)).op_floor(context), n, b);
public IRubyObject floor(ThreadContext context, IRubyObject n) {
return roundCommon(context, n, RoundingMode.FLOOR);
}

/** nurat_ceil
*
// MRI: nurat_floor
private IRubyObject mriFloor(ThreadContext context) {
return num.op_idiv(context, den);
}

/**
* MRI: nurat_ceil_n
*/
@Override
@JRubyMethod(name = "ceil")
public IRubyObject op_ceil(ThreadContext context) {
return f_negate(context, f_idiv(context, f_negate(context, num), den));
public IRubyObject ceil(ThreadContext context) {
return roundCommon(context, context.nil, RoundingMode.CEILING);
}

@JRubyMethod(name = "ceil")
public IRubyObject op_ceil(ThreadContext context, IRubyObject n) {
IRubyObject b = op_roundCommonPre(context, n);
return op_roundCommonPost(context, ((RubyRational)f_mul(context, this, b)).op_ceil(context), n, b);
public IRubyObject ceil(ThreadContext context, IRubyObject n) {
return roundCommon(context, n, RoundingMode.CEILING);
}

// MRI: nurat_ceil
private IRubyObject mriCeil(ThreadContext context) {
return ((RubyInteger) ((RubyInteger) num.op_uminus()).op_idiv(context, den)).op_uminus();
}

@JRubyMethod(name = "to_i")
public IRubyObject to_i(ThreadContext context) {
return op_truncate(context);
return truncate(context);
}

/** nurat_truncate
*
/**
* MRI: nurat_truncate
*/
@JRubyMethod(name = "truncate")
public IRubyObject op_truncate(ThreadContext context) {
if (f_negative_p(context, num)) {
return f_negate(context, f_idiv(context, f_negate(context, num), den));
}
return f_idiv(context, num, den);
public IRubyObject truncate(ThreadContext context) {
return roundCommon(context, context.nil, RoundingMode.UNNECESSARY);
}

@JRubyMethod(name = "truncate")
public IRubyObject op_truncate(ThreadContext context, IRubyObject n) {
IRubyObject b = op_roundCommonPre(context, n);
return op_roundCommonPost(context, ((RubyRational)f_mul(context, this, b)).op_truncate(context), n, b);
public IRubyObject truncate(ThreadContext context, IRubyObject n) {
return roundCommon(context, n, RoundingMode.UNNECESSARY);
}

private IRubyObject mriTruncate(ThreadContext context) {
if (num.isNegative(context).isTrue()) {
return ((RubyInteger) ((RubyInteger) num.op_uminus()).op_idiv(context, den)).op_uminus();
}
return num.op_idiv(context, den);
}

/** nurat_round
*
*/
@JRubyMethod(name = "round")
public IRubyObject op_round(ThreadContext context) {
IRubyObject myNum = this.num;
boolean neg = f_negative_p(context, myNum);
if (neg) myNum = f_negate(context, myNum);
public IRubyObject round(ThreadContext context) {
return roundCommon(context, context.nil, RoundingMode.HALF_UP);
}

IRubyObject myDen = this.den;
IRubyObject two = RubyFixnum.two(context.runtime);
myNum = f_add(context, f_mul(context, myNum, two), myDen);
myDen = f_mul(context, myDen, two);
myNum = f_idiv(context, myNum, myDen);
@JRubyMethod(name = "round")
public IRubyObject round(ThreadContext context, IRubyObject n) {
Ruby runtime = context.runtime;

IRubyObject opts = ArgsUtil.getOptionsArg(runtime, n);
if (!opts.isNil()) {
n = context.nil;
}

RoundingMode mode = RubyNumeric.getRoundingMode(context, opts);

if (neg) myNum = f_negate(context, myNum);
return myNum;
return roundCommon(context, n, mode);
}

@JRubyMethod(name = "round")
public IRubyObject op_round(ThreadContext context, IRubyObject n) {
IRubyObject b = op_roundCommonPre(context, n);
return op_roundCommonPost(context, ((RubyNumeric) f_mul(context, this, b)).round(), n, b);
public IRubyObject round(ThreadContext context, IRubyObject n, IRubyObject opts) {
Ruby runtime = context.runtime;

opts = ArgsUtil.getOptionsArg(runtime, opts);
if (!opts.isNil()) {
n = context.nil;
}

RoundingMode mode = RubyNumeric.getRoundingMode(context, opts);

return roundCommon(context, n, mode);
}

// MRI: f_round_common
private IRubyObject roundCommon(ThreadContext context, IRubyObject n, RoundingMode mode) {
Ruby runtime = context.runtime;
IRubyObject b, s;

if (n.isNil()) {
return doRound(context, mode);
}

if (!(n instanceof RubyInteger)) {
throw runtime.newTypeError(n, getRuntime().getInteger());
}

b = runtime.newFixnum(10).op_pow(context, n);
s = this.op_mul(context, b);

if (s instanceof RubyFloat) {
if (((RubyFloat) n).getDoubleValue() < 0.0) {
return RubyFixnum.zero(runtime);
}
return this;
}

if (!(s instanceof RubyRational)) {
s = RubyRational.newRational(context, getMetaClass(), s, RubyFixnum.one(runtime));
}

s = ((RubyRational) s).doRound(context, mode);

s = RubyRational.newRational(context, getMetaClass(), s, RubyFixnum.one(runtime));

if (s instanceof RubyRational && ((RubyInteger) n).op_cmp(context, RubyFixnum.one(runtime)).convertToInteger().getLongValue() < 0) {
s = ((RubyRational) s).truncate(context);
}

return s;
}

private IRubyObject doRound(ThreadContext context, RoundingMode mode) {
switch (mode) {
case HALF_UP:
return roundHalfUp(context);
case HALF_EVEN:
return roundHalfEven(context);
case HALF_DOWN:
return roundHalfDown(context);
case FLOOR:
return mriFloor(context);
case CEILING:
return mriCeil(context);
case UNNECESSARY:
return mriTruncate(context);
default:
throw context.runtime.newRuntimeError("BUG: invalid rounding mode: " + mode);
}
}

// MRI: nurat_round_half_down
private IRubyObject roundHalfDown(ThreadContext context) {
Ruby runtime = context.runtime;

RubyInteger num = this.num, den = this.den;
IRubyObject neg;

neg = num.isNegative(context);

if (neg.isTrue()) {
num = (RubyInteger) num.op_uminus();
}

num = (RubyInteger) ((RubyInteger) num.op_mul(context, RubyFixnum.two(runtime))).op_plus(context, den);
num = (RubyInteger) num.op_minus(context, RubyFixnum.one(runtime));
den = (RubyInteger) den.op_mul(context, RubyFixnum.two(runtime));
num = (RubyInteger) num.op_idiv(context, den);

if (neg.isTrue())
num = (RubyInteger) num.op_uminus();

return num;
}

// MRI: nurat_round_half_even
private IRubyObject roundHalfEven(ThreadContext context) {
Ruby runtime = context.runtime;

RubyInteger num = this.num, den = this.den;
IRubyObject neg;
RubyArray qr;

neg = num.isNegative(context);

if (neg.isTrue()) {
num = (RubyInteger) num.op_uminus(context);
}

num = (RubyInteger) num.op_minus(context, RubyFixnum.one(runtime));
num = (RubyInteger) num.op_idiv(context, den);

num = (RubyInteger) ((RubyInteger) num.op_mul(context, RubyFixnum.two(runtime))).op_plus(context, den);
den = (RubyInteger) den.op_mul(context, RubyFixnum.two(runtime));
qr = (RubyArray) num.divmod(context, den);
num = (RubyInteger) qr.eltOk(0);
if (((RubyInteger) qr.eltOk(1)).zero_p(context).isTrue()) {
num = (RubyInteger) num.op_and(context, RubyFixnum.newFixnum(runtime, ~1L));
}

if (neg.isTrue()) {
num = (RubyInteger) num.op_uminus(context);
}

return num;
}

// MRI: nurat_round_half_up
private IRubyObject roundHalfUp(ThreadContext context) {
Ruby runtime = context.runtime;

RubyInteger num = this.num, den = this.den;
IRubyObject neg;

neg = num.isNegative(context);

if (neg.isTrue()) {
num = (RubyInteger) num.op_uminus();
}

num = (RubyInteger) ((RubyInteger) num.op_mul(context, RubyFixnum.two(runtime))).op_plus(context, den);
den = (RubyInteger) den.op_mul(context, RubyFixnum.two(runtime));
num = (RubyInteger) num.op_idiv(context, den);

if (neg.isTrue()) {
num = (RubyInteger) num.op_uminus();
}

return num;
}

/** nurat_to_f
@@ -1059,8 +1203,8 @@ public IRubyObject marshal_load(ThreadContext context, IRubyObject arg) {
den = f_negate(context, den);
}

this.num = num;
this.den = den;
this.num = (RubyInteger) num;
this.den = (RubyInteger) den;

if (load.hasVariables()) syncVariables((IRubyObject)load);
return this;
@@ -1091,8 +1235,8 @@ public Object unmarshalFrom(Ruby runtime, RubyClass type,
den = f_negate(context, den);
}

r.num = num;
r.den = den;
r.num = (RubyInteger) num;
r.den = (RubyInteger) den;

return r;
}
@@ -1184,6 +1328,26 @@ public static IRubyObject numericQuo(ThreadContext context, IRubyObject x, IRuby
return sites(context).op_quo.call(context, x, x, y);
}

@Deprecated
public IRubyObject op_floor(ThreadContext context) {
return floor(context);
}

@Deprecated
public IRubyObject op_floor(ThreadContext context, IRubyObject n) {
return floor(context, n);
}

@Deprecated
public IRubyObject op_ceil(ThreadContext context) {
return ceil(context);
}

@Deprecated
public IRubyObject op_ceil(ThreadContext context, IRubyObject n) {
return ceil(context, n);
}

private static JavaSites.RationalSites sites(ThreadContext context) {
return context.sites.Rational;
}
4 changes: 4 additions & 0 deletions core/src/main/java/org/jruby/runtime/JavaSites.java
Original file line number Diff line number Diff line change
@@ -220,6 +220,8 @@ public static class FixnumSites {
public final CallSite op_le = new FunctionalCachingCallSite("<=");
public final CallSite op_gt = new FunctionalCachingCallSite(">");
public final CallSite op_lt = new FunctionalCachingCallSite("<");
public final CachingCallSite basic_op_lt = new FunctionalCachingCallSite("<");
public final CachingCallSite basic_op_gt = new FunctionalCachingCallSite(">");
public final CallSite op_exp_complex = new FunctionalCachingCallSite("**");
public final CallSite op_lt_bignum = new FunctionalCachingCallSite("<");
public final CallSite op_exp_rational = new FunctionalCachingCallSite("**");
@@ -245,6 +247,8 @@ public static class BignumSites {
public final CheckedSites checked_op_xor = new CheckedSites("^");
public final CallSite op_cmp = new FunctionalCachingCallSite("<=>");
public final CallSite fdiv = new FunctionalCachingCallSite("fdiv");
public final CachingCallSite basic_op_lt = new FunctionalCachingCallSite("<");
public final CachingCallSite basic_op_gt = new FunctionalCachingCallSite(">");
}

public static class FloatSites {

0 comments on commit 2ee022d

Please sign in to comment.