summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/lib
diff options
context:
space:
mode:
authorKenta Murata <mrkn@mrkn.jp>2020-12-18 23:46:26 +0900
committerKenta Murata <mrkn@mrkn.jp>2020-12-19 22:13:53 +0900
commite1424c35012ccf1f3822c9046081b225aef4142e (patch)
tree8eb32ec210261bae5940d3af11b13903bcbb1112 /ext/bigdecimal/lib
parent4735a5b9d2cbde69c501ee8d5bb570f4fac7e51d (diff)
[bigdecimal] Fix the default precision of Float#to_d
Fix https://github.com/ruby/bigdecimal/issues/70 [Bug #13331] https://github.com/ruby/bigdecimal/commit/aa536cd4b5
Diffstat (limited to 'ext/bigdecimal/lib')
-rw-r--r--ext/bigdecimal/lib/bigdecimal/util.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/bigdecimal/lib/bigdecimal/util.rb b/ext/bigdecimal/lib/bigdecimal/util.rb
index 66fff7867b8..00a3e967bd5 100644
--- a/ext/bigdecimal/lib/bigdecimal/util.rb
+++ b/ext/bigdecimal/lib/bigdecimal/util.rb
@@ -43,7 +43,7 @@ class Float < Numeric
#
# See also BigDecimal::new.
#
- def to_d(precision=Float::DIG)
+ def to_d(precision=Float::DIG+1)
BigDecimal(self, precision)
end
end