if (context.getPrecision() > RubyFloat.DIG + 1) {
throw runtime.newArgumentError("precision too large");
}
return new RubyBigDecimal(runtime, (RubyClass)recv, new BigDecimal(((RubyFloat)args[0]).getDoubleValue(), context));
} else {
RubyRational rat = (RubyRational)args[0];
BigDecimal num = new BigDecimal(rat.numerator(ctx).convertToInteger().getLongValue());
BigDecimal den = new BigDecimal(rat.denominator(ctx).convertToInteger().getLongValue());
BigDecimal value = num.divide(den, context);
return new RubyBigDecimal(runtime, value);
}