From 2cd83035a867cec68323d32c975fccf311675055 Mon Sep 17 00:00:00 2001 From: nagachika Date: Sat, 21 Dec 2013 05:55:08 +0000 Subject: merge revision(s) 43669,43672,43678: [Backport #8958] * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] Document the required +precision+ argument for Rational#to_d [Bug #8958] * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] +precision+ is required * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] remove example of Rational#to_d without argument. [Bug #8958] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@44314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/bigdecimal/lib/bigdecimal/util.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'ext') diff --git a/ext/bigdecimal/lib/bigdecimal/util.rb b/ext/bigdecimal/lib/bigdecimal/util.rb index b27e64c511..4c8fc07b7d 100644 --- a/ext/bigdecimal/lib/bigdecimal/util.rb +++ b/ext/bigdecimal/lib/bigdecimal/util.rb @@ -83,16 +83,17 @@ end class Rational < Numeric # call-seq: - # r.to_d -> bigdecimal - # r.to_d(sig) -> bigdecimal + # r.to_d(precision) -> bigdecimal # - # Converts a Rational to a BigDecimal. Takes an optional parameter +sig+ to - # limit the amount of significant digits. + # Converts a Rational to a BigDecimal. + # + # The required +precision+ parameter is used to determine the amount of + # significant digits for the result. See BigDecimal#div for more information, + # as it is used along with the #denominator and the +precision+ for + # parameters. # # r = (22/7.0).to_r # # => (7077085128725065/2251799813685248) - # r.to_d - # # => # # r.to_d(3) # # => # def to_d(precision) -- cgit v1.2.3