diff options
| -rw-r--r-- | ChangeLog | 14 | ||||
| -rw-r--r-- | ext/bigdecimal/lib/bigdecimal/util.rb | 13 | ||||
| -rw-r--r-- | version.h | 2 |
3 files changed, 22 insertions, 7 deletions
@@ -1,3 +1,17 @@ +Sat Dec 21 14:54:37 2013 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org> + + * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] remove example of + Rational#to_d without argument. [Bug #8958] + +Sat Dec 21 14:54:37 2013 Zachary Scott <e@zzak.io> + + * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] +precision+ is required + +Sat Dec 21 14:54:37 2013 Zachary Scott <e@zzak.io> + + * ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] Document the required + +precision+ argument for Rational#to_d [Bug #8958] + Sat Dec 21 03:46:14 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/date/date_strptime.c (date__strptime_internal): unset 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 - # # => #<BigDecimal:1a52bd8,'0.3142857142 8571427937 0154144999 105E1',45(63)> # r.to_d(3) # # => #<BigDecimal:1a44d08,'0.314E1',18(36)> def to_d(precision) @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2013-12-21" -#define RUBY_PATCHLEVEL 360 +#define RUBY_PATCHLEVEL 361 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 12 |
