@JRubyMethod(name = "*", required = 1, compat = RUBY1_9) public IRubyObject op_mul19(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; BigInteger result; if (other instanceof RubyFixnum) { return bignorm(runtime, value.multiply(fix2big(((RubyFixnum) other)))); } else if (other instanceof RubyBignum) { return bignorm(runtime, value.multiply(((RubyBignum)other).value)); } else return opMulOther(context, other); }
@JRubyMethod(name = "*", required = 1, compat = RUBY1_9) public IRubyObject op_mul19(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; BigInteger result; if (other instanceof RubyFixnum) { return bignorm(runtime, value.multiply(fix2big(((RubyFixnum) other)))); } else if (other instanceof RubyBignum) { return bignorm(runtime, value.multiply(((RubyBignum)other).value)); } else return opMulOther(context, other); }
/** rb_big_mul * */ @JRubyMethod(name = "*", required = 1) public IRubyObject op_mul(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; if (other instanceof RubyFixnum) { BigInteger result = value.multiply(fix2big(((RubyFixnum) other))); return result.signum() == 0 ? RubyFixnum.zero(runtime) : new RubyBignum(runtime, result); } if (other instanceof RubyBignum) { BigInteger result = value.multiply(((RubyBignum)other).value); return result.signum() == 0 ? RubyFixnum.zero(runtime) : new RubyBignum(runtime, result); } else return opMulOther(context, other); }
/** rb_big_mul * */ @JRubyMethod(name = "*", required = 1) public IRubyObject op_mul(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; if (other instanceof RubyFixnum) { BigInteger result = value.multiply(fix2big(((RubyFixnum) other))); return result.signum() == 0 ? RubyFixnum.zero(runtime) : new RubyBignum(runtime, result); } if (other instanceof RubyBignum) { BigInteger result = value.multiply(((RubyBignum)other).value); return result.signum() == 0 ? RubyFixnum.zero(runtime) : new RubyBignum(runtime, result); } else return opMulOther(context, other); }