public IRubyObject idiv(ThreadContext context, IRubyObject other, CallSite site) { if (other instanceof RubyFixnum) { return idivLong(context, value, ((RubyFixnum) other).value); } return coerceBin(context, site, other); }
@Deprecated public IRubyObject idiv(ThreadContext context, IRubyObject other, String method) { if (other instanceof RubyFixnum) { return idivLong(context, value, ((RubyFixnum) other).value); } return coerceBin(context, method, other); }
public IRubyObject idiv(ThreadContext context, IRubyObject other, CallSite site) { if (other instanceof RubyFixnum) { return idivLong(context, value, ((RubyFixnum) other).value); } return coerceBin(context, site, other); }
public IRubyObject idiv(ThreadContext context, IRubyObject other, String method) { if (other instanceof RubyFixnum) { return idivLong(context, value, ((RubyFixnum) other).value); } return coerceBin(context, method, other); }
@Deprecated public IRubyObject idiv(ThreadContext context, IRubyObject other, String method) { if (other instanceof RubyFixnum) { return idivLong(context, value, ((RubyFixnum) other).value); } return coerceBin(context, method, other); }
private IRubyObject powerOther(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; if (other instanceof RubyFloat) { return RubyFloat.newFloat(runtime, Math.pow(value, ((RubyFloat) other) .getDoubleValue())); } return coerceBin(context, "**", other); }
private IRubyObject powerOther(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; if (other instanceof RubyFloat) { return RubyFloat.newFloat(runtime, Math.pow(value, ((RubyFloat) other) .getDoubleValue())); } return coerceBin(context, "**", other); }
private IRubyObject addOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return ((RubyBignum) other).op_plus(context, this); } if (other instanceof RubyFloat) { return context.runtime.newFloat((double) value + ((RubyFloat) other).getDoubleValue()); } return coerceBin(context, "+", other); }
/** fix_mod * */ @Override public IRubyObject op_mod(ThreadContext context, IRubyObject other) { checkZeroDivisionError(context, other); if (other instanceof RubyFixnum) { return moduloFixnum(context, (RubyFixnum) other); } return coerceBin(context, sites(context).op_mod, other); }
/** fix_divmod * */ @Override public IRubyObject divmod(ThreadContext context, IRubyObject other) { checkZeroDivisionError(context, other); if (other instanceof RubyFixnum) { return divmodFixnum(context, (RubyFixnum) other); } return coerceBin(context, sites(context).divmod, other); }
/** fix_divmod * */ @Override public IRubyObject divmod(ThreadContext context, IRubyObject other) { checkZeroDivisionError(context, other); if (other instanceof RubyFixnum) { return divmodFixnum(context, (RubyFixnum) other); } return coerceBin(context, sites(context).divmod, other); }
private IRubyObject addOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return ((RubyBignum) other).op_plus(context, this); } if (other instanceof RubyFloat) { return context.runtime.newFloat((double) value + ((RubyFloat) other).getDoubleValue()); } return coerceBin(context, "+", other); }
/** fix_mod * */ @Override public IRubyObject op_mod(ThreadContext context, IRubyObject other) { checkZeroDivisionError(context, other); if (other instanceof RubyFixnum) { return moduloFixnum(context, (RubyFixnum) other); } return coerceBin(context, sites(context).op_mod, other); }
private IRubyObject multiplyOther(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; if (other instanceof RubyBignum) { return ((RubyBignum) other).op_mul(context, this.value); } if (other instanceof RubyFloat) { return runtime.newFloat((double) value * ((RubyFloat) other).getDoubleValue()); } return coerceBin(context, sites(context).op_times, other); }
private IRubyObject addOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return ((RubyBignum) other).op_plus(context, this.value); } if (other instanceof RubyFloat) { return context.runtime.newFloat((double) value + ((RubyFloat) other).getDoubleValue()); } return coerceBin(context, sites(context).op_plus, other); }
private IRubyObject multiplyOther(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; if (other instanceof RubyBignum) { return ((RubyBignum) other).op_mul(context, this.value); } if (other instanceof RubyFloat) { return runtime.newFloat((double) value * ((RubyFloat) other).getDoubleValue()); } return coerceBin(context, sites(context).op_times, other); }
/** fix_divmod * */ @JRubyMethod(name = "divmod") @Override public IRubyObject divmod(ThreadContext context, IRubyObject other) { if (context.runtime.is1_9()) checkZeroDivisionError(context, other); if (other instanceof RubyFixnum) { return divmodFixnum(context, other); } return coerceBin(context, "divmod", other); }
private IRubyObject addOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return ((RubyBignum) other).op_plus(context, this.value); } if (other instanceof RubyFloat) { return context.runtime.newFloat((double) value + ((RubyFloat) other).getDoubleValue()); } return coerceBin(context, sites(context).op_plus, other); }
private IRubyObject subtractOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBignum.newBignum(context.runtime, value).op_minus(context, ((RubyBignum) other).value); } if (other instanceof RubyFloat) { return context.runtime.newFloat((double) value - ((RubyFloat) other).getDoubleValue()); } return coerceBin(context, sites(context).op_minus, other); }
private IRubyObject subtractOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBignum.newBignum(context.runtime, value).op_minus(context, ((RubyBignum) other).value); } if (other instanceof RubyFloat) { return context.runtime.newFloat((double) value - ((RubyFloat) other).getDoubleValue()); } return coerceBin(context, sites(context).op_minus, other); }