class Rational
def to_d(precision=0)
See also Kernel.BigDecimal.
Rational(22, 7).to_d(3) # => 0.314e1
require 'bigdecimal/util'
require 'bigdecimal'
The default +precision+ is +0+.
automatically.
the number of digits to represent the float being converted is determined
significant digits for the result. When +precision+ is set to +0+,
The +precision+ parameter is used to determine the number of
Returns the value as a BigDecimal.
rat.to_d(precision) -> bigdecimal
call-seq:
def to_d(precision=0) BigDecimal(self, precision) end