summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-13 10:23:14 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-13 10:23:14 +0000
commita369b7f7cbf2c3232879b29162b5dd50b49db2ab (patch)
tree04617217e47e06eb16920155bb721d164d5526c2 /ext
parent4c1e390fa8abf8d3e544fa21a8552ffb92a5119d (diff)
* ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] Document the required
+precision+ argument for Rational#to_d [Bug #8958] -This line, and those below, will be ignored-- M ChangeLog M ext/bigdecimal/lib/bigdecimal/util.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/bigdecimal/lib/bigdecimal/util.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/bigdecimal/lib/bigdecimal/util.rb b/ext/bigdecimal/lib/bigdecimal/util.rb
index 3673d88cc2..2781150557 100644
--- a/ext/bigdecimal/lib/bigdecimal/util.rb
+++ b/ext/bigdecimal/lib/bigdecimal/util.rb
@@ -105,10 +105,14 @@ 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)