int sign2 = val.isInfinity() ? val.infinitySign : val.value.signum();
return newInfinity(runtime, sign1 * sign2);
}
BigDecimal res = value.multiply(val.value);
if (res.precision() > digits) {
// TODO: rounding mode should not be hard-coded. See #mode.
res = res.round(new MathContext(digits, RoundingMode.HALF_UP));
}
return new RubyBigDecimal(runtime, res).setResult();
}