private IRubyObject compareOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return newFixnum(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).value)); } if (other instanceof RubyFloat) { return dbl_cmp(context.runtime, (double) value, ((RubyFloat) other).getDoubleValue()); } return coerceCmp(context, sites(context).op_cmp, other); }
private IRubyObject compareOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return newFixnum(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum) other).value)); } if (other instanceof RubyFloat) { return dbl_cmp(context.runtime, (double) value, ((RubyFloat) other).getDoubleValue()); } return coerceCmp(context, sites(context).op_cmp, other); }
private IRubyObject compareOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return newFixnum(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum)other).getValue())); } if (other instanceof RubyFloat) { return dbl_cmp(context.runtime, (double)value, ((RubyFloat)other).getDoubleValue()); } return coerceCmp(context, "<=>", other); }
private IRubyObject compareOther(ThreadContext context, IRubyObject other) { if (other instanceof RubyBignum) { return newFixnum(context.runtime, BigInteger.valueOf(value).compareTo(((RubyBignum)other).getValue())); } if (other instanceof RubyFloat) { return dbl_cmp(context.runtime, (double)value, ((RubyFloat)other).getDoubleValue()); } return coerceCmp(context, "<=>", other); }