class Float

def to_d(precision=0)


See also BigDecimal::new.

1.234.to_d(2) # => 0.12e1
1.234.to_d # => 0.1234e1
0.5.to_d # => 0.5e0

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 of +float+ as a BigDecimal.

float.to_d(precision) -> bigdecimal
float.to_d -> bigdecimal
call-seq:
def to_d(precision=0)
  BigDecimal(self, precision)
end