Join GitHub today
BigMath.log(Rational,...) produces garbage digits within the requested precision #4158
JRuby 184.108.40.206 on OpenJDK 1.8.0_101 on x86-64
MRI seems to perform the division of the numerator with the denominator with the requested precision (50 decimal digits in the example), and then it performs the logarithm with the requested precision.
JRuby seems to perform the division only with double precision (about 14 decimal digits, which is far lower than the requested precision), and then it performs the logarithm with the requested precision. If this is the case, then JRuby should not call ".to_f", but ".to_d(precision)" on the argument to BigDecimal.log.