public static RubyBignum newBignum(Ruby runtime, BigInteger value) { return new RubyBignum(runtime, value); }
public static RubyBignum newBignum(Ruby runtime, String value) { return new RubyBignum(runtime, new BigInteger(value)); }
@Override public final IRubyObject op_minus(ThreadContext context, long other) { BigInteger result = value.subtract(BigInteger.valueOf(other)); if (value.signum() < 0 && other > 0) return new RubyBignum(context.runtime, result); return bignorm(context.runtime, result); }
@Override public final IRubyObject op_minus(ThreadContext context, long other) { BigInteger result = value.subtract(BigInteger.valueOf(other)); if (value.signum() < 0 && other > 0) return new RubyBignum(context.runtime, result); return bignorm(context.runtime, result); }
public final IRubyObject op_minus(ThreadContext context, BigInteger other) { BigInteger result = value.subtract(other); if (value.signum() < 0 && other.signum() > 0) return new RubyBignum(context.runtime, result); return bignorm(context.runtime, result); }
public final IRubyObject op_plus(ThreadContext context, BigInteger other) { BigInteger result = value.add(other); if (value.signum() > 0 && other.signum() > 0) return new RubyBignum(context.runtime, result); return bignorm(context.runtime, result); }
@Override public final IRubyObject op_plus(ThreadContext context, long other) { BigInteger result = value.add(BigInteger.valueOf(other)); if (other > 0 && value.signum() > 0) return new RubyBignum(context.runtime, result); return bignorm(context.runtime, result); }
public final IRubyObject op_minus(ThreadContext context, BigInteger other) { BigInteger result = value.subtract(other); if (value.signum() < 0 && other.signum() > 0) return new RubyBignum(context.runtime, result); return bignorm(context.runtime, result); }
public final IRubyObject op_plus(ThreadContext context, BigInteger other) { BigInteger result = value.add(other); if (value.signum() > 0 && other.signum() > 0) return new RubyBignum(context.runtime, result); return bignorm(context.runtime, result); }
@Override public final IRubyObject op_plus(ThreadContext context, long other) { BigInteger result = value.add(BigInteger.valueOf(other)); if (other > 0 && value.signum() > 0) return new RubyBignum(context.runtime, result); return bignorm(context.runtime, result); }
public IRubyObject op_mul(ThreadContext context, long other) { Ruby runtime = context.runtime; BigInteger result = value.multiply(long2big(other)); return result.signum() == 0 ? RubyFixnum.zero(runtime) : new RubyBignum(runtime, result); }
public IRubyObject op_mul(ThreadContext context, long other) { Ruby runtime = context.runtime; BigInteger result = value.multiply(long2big(other)); return result.signum() == 0 ? RubyFixnum.zero(runtime) : new RubyBignum(runtime, result); }
private IRubyObject addBignum(BigInteger other) { BigInteger result = value.add(other); if (value.signum() > 0 && other.signum() > 0) return new RubyBignum(getRuntime(), result); return bignorm(getRuntime(), result); }
private IRubyObject addBignum(BigInteger other) { BigInteger result = value.add(other); if (value.signum() > 0 && other.signum() > 0) return new RubyBignum(getRuntime(), result); return bignorm(getRuntime(), result); }
private IRubyObject subtractFixnum(long other) { BigInteger result = value.subtract(BigInteger.valueOf(other)); if (value.signum() < 0 && other > 0) return new RubyBignum(getRuntime(), result); return bignorm(getRuntime(), result); }
private IRubyObject addFixnum(long other) { BigInteger result = value.add(BigInteger.valueOf(other)); if (other > 0 && value.signum() > 0) return new RubyBignum(getRuntime(), result); return bignorm(getRuntime(), result); }
private IRubyObject addFixnum(long other) { BigInteger result = value.add(BigInteger.valueOf(other)); if (other > 0 && value.signum() > 0) return new RubyBignum(getRuntime(), result); return bignorm(getRuntime(), result); }
private IRubyObject subtractFixnum(long other) { BigInteger result = value.subtract(BigInteger.valueOf(other)); if (value.signum() < 0 && other > 0) return new RubyBignum(getRuntime(), result); return bignorm(getRuntime(), result); }
private IRubyObject subtractBignum(BigInteger other) { BigInteger result = value.subtract(other); if (value.signum() < 0 && other.signum() > 0) return new RubyBignum(getRuntime(), result); return bignorm(getRuntime(), result); }
private IRubyObject subtractBignum(BigInteger other) { BigInteger result = value.subtract(other); if (value.signum() < 0 && other.signum() > 0) return new RubyBignum(getRuntime(), result); return bignorm(getRuntime(), result); }