/** fix_rshift * */ @Override public IRubyObject op_rshift(ThreadContext context, IRubyObject other) { if (!(other instanceof RubyFixnum)) { return RubyBignum.newBignum(context.runtime, value).op_rshift(context, other); } return op_rshift(context, ((RubyFixnum) other).value); }
/** fix_rshift * */ @Override public IRubyObject op_rshift(ThreadContext context, IRubyObject other) { if (!(other instanceof RubyFixnum)) { return RubyBignum.newBignum(context.runtime, value).op_rshift(context, other); } return op_rshift(context, ((RubyFixnum) other).value); }
/** rb_big_rshift * */ @Override public IRubyObject op_rshift(ThreadContext context, IRubyObject other) { long shift; for (;;) { if (other instanceof RubyFixnum) { shift = ((RubyFixnum) other).getLongValue(); break; } else if (other instanceof RubyBignum) { RubyBignum otherBignum = (RubyBignum) other; if (otherBignum.value.signum() >= 0) { IRubyObject tmp = otherBignum.checkShiftDown(context, this); if (tmp != null) return tmp; } shift = big2long(otherBignum); break; } other = other.convertToInteger(); } return op_rshift(context, shift); }
/** rb_big_rshift * */ @Override public IRubyObject op_rshift(ThreadContext context, IRubyObject other) { long shift; for (;;) { if (other instanceof RubyFixnum) { shift = ((RubyFixnum) other).getLongValue(); break; } else if (other instanceof RubyBignum) { RubyBignum otherBignum = (RubyBignum) other; if (otherBignum.value.signum() >= 0) { IRubyObject tmp = otherBignum.checkShiftDown(context, this); if (tmp != null) return tmp; } shift = big2long(otherBignum); break; } other = other.convertToInteger(); } return op_rshift(context, shift); }
/** fix_rshift * */ @JRubyMethod(name = ">>") public IRubyObject op_rshift(IRubyObject other) { if (!(other instanceof RubyFixnum)) return RubyBignum.newBignum(getRuntime(), value).op_rshift(other); return op_rshift(((RubyFixnum)other).getLongValue()); }
/** fix_rshift * */ @JRubyMethod(name = ">>") public IRubyObject op_rshift(IRubyObject other) { if (!(other instanceof RubyFixnum)) return RubyBignum.newBignum(getRuntime(), value).op_rshift(other); return op_rshift(((RubyFixnum)other).getLongValue()); }