class Rational

def to_d(precision)

# => 0.314e1
r.to_d(3)
# => (7077085128725065/2251799813685248)
r = (22/7.0).to_r

parameters.
as it is used along with the #denominator and the +precision+ for
significant digits for the result. See BigDecimal#div for more information,
The required +precision+ parameter is used to determine the amount of

Converts a Rational to a BigDecimal.

r.to_d(precision) -> bigdecimal
call-seq:
def to_d(precision)
  if precision <= 0
    raise ArgumentError, "negative precision"
  end
  num = self.numerator
  BigDecimal(num).div(self.denominator, precision)
end