private IRubyObject op_ltOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).value) < 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value < ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, sites(context).op_lt, other); }
private IRubyObject op_gtOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).value) > 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value > ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, sites(context).op_gt, other); }
private IRubyObject op_geOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).value) >= 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value >= ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, sites(context).op_ge, other); }
private IRubyObject op_ltOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).getValue()) < 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value < ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, "<", other); }
private IRubyObject op_geOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).getValue()) >= 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value >= ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, ">=", other); }
private IRubyObject op_leOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).value) <= 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value <= ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, sites(context).op_le, other); }
private IRubyObject op_leOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).value) <= 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value <= ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, sites(context).op_le, other); }
private IRubyObject op_ltOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).getValue()) < 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value < ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, "<", other); }
private IRubyObject op_geOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).value) >= 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value >= ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, sites(context).op_ge, other); }
private IRubyObject op_ltOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).value) < 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value < ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, sites(context).op_lt, other); }
private IRubyObject op_gtOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).value) > 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value > ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, sites(context).op_gt, other); }
private IRubyObject op_leOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).getValue()) <= 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value <= ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, "<=", other); }
private IRubyObject op_geOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).getValue()) >= 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value >= ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, ">=", other); }
private IRubyObject op_gtOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return RubyBoolean.newBoolean(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).getValue()) > 0); } if (other instanceof RubyFloat) { return RubyBoolean.newBoolean(context.runtime, (double) value > ((RubyFloat) other).getDoubleValue()); } return coerceRelOp(context, ">", other); }
/** fix_gt * */ @JRubyMethod(name = ">") public IRubyObject op_gt(ThreadContext context, IRubyObject other) { if (other instanceof RubyFixnum) { return RubyBoolean.newBoolean(context.runtime, value > ((RubyFixnum) other).value); } return context.is19 ? op_gtOther(context, other) : coerceRelOp(context, ">", other); }
/** fix_gt * */ @JRubyMethod(name = ">") public IRubyObject op_gt(ThreadContext context, IRubyObject other) { if (other instanceof RubyFixnum) { return RubyBoolean.newBoolean(context.runtime, value > ((RubyFixnum) other).value); } return context.is19 ? op_gtOther(context, other) : coerceRelOp(context, ">", other); }
/** fix_ge * */ @JRubyMethod(name = ">=") public IRubyObject op_ge(ThreadContext context, IRubyObject other) { if (other instanceof RubyFixnum) { return RubyBoolean.newBoolean(context.runtime, value >= ((RubyFixnum) other).value); } return context.is19 ? op_geOther(context, other) : coerceRelOp(context, ">=", other); }
/** fix_le * */ @JRubyMethod(name = "<=") public IRubyObject op_le(ThreadContext context, IRubyObject other) { if (other instanceof RubyFixnum) { return RubyBoolean.newBoolean(context.runtime, value <= ((RubyFixnum) other).value); } return context.is19 ? op_leOther(context, other) : coerceRelOp(context, "<=", other); }
/** fix_ge * */ @JRubyMethod(name = ">=") public IRubyObject op_ge(ThreadContext context, IRubyObject other) { if (other instanceof RubyFixnum) { return RubyBoolean.newBoolean(context.runtime, value >= ((RubyFixnum) other).value); } return context.is19 ? op_geOther(context, other) : coerceRelOp(context, ">=", other); }
/** fix_le * */ @JRubyMethod(name = "<=") public IRubyObject op_le(ThreadContext context, IRubyObject other) { if (other instanceof RubyFixnum) { return RubyBoolean.newBoolean(context.runtime, value <= ((RubyFixnum) other).value); } return context.is19 ? op_leOther(context, other) : coerceRelOp(context, "<=", other); }