Class | Rational
In: | bigdecimal/lib/bigdecimal/util.rb
Parent: | Numeric

### Methods

to_d

### Public Instance methods

to_d(nFig=0)

Convert Rational to BigDecimal

[Source]

    # File bigdecimal/lib/bigdecimal/util.rb, line 61
      def to_d(nFig=0)
         num = self.numerator.to_s
         if nFig<=0
            nFig = BigDecimal.double_fig*2+1
         end
         BigDecimal.new(num).div(self.denominator,nFig)
      end

[Validate]