Bug #5098
closedbigdecimal/util.rb で定義される to_d メソッドによる型変換と、BigDecimal 関数による型変換が整合していない
Description
BigDecimal() および BigDecimal#coerce との関係より、以下のように修正が必要。
- Float#to_d はオプショナルな精度を受け付けるように変更し、精度が省略された場合は Float::DIG が指定されたものとする。
- Rational#to_d は精度を必須とする。
- Integer#to_d を追加する。
Added by Kenta Murata over 13 years ago
Added by Kenta Murata over 13 years ago
- ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): modified for
specifying precision. fixes #5098. [ruby-dev:44210] - test/bigdecimal/test_bigdecimal_util.rb: add test for the above
change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Added by Kenta Murata over 13 years ago
- ext/bigdecimal/lib/bigdecimal/util.rb (Rational#to_d):
zero or negative precision is error. fixes #5098.
[ruby-dev:44210] - test/bigdecimal/test_bigdecimal_util.rb: add test for the above
change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Added by Kenta Murata over 13 years ago
Merge revisions 32676, 32677, 32679, 32680:
* ext/bigdecimal/lib/bigdecimal/util.rb (Rational#to_d):
zero or negative precision is error. fixes #5098.
[ruby-dev:44210]
* ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): modified for
specifying precision. fixes #5098. [ruby-dev:44210]
* ext/bigdecimal/lib/bigdecimal/util.rb (Integer#to_d): added
for symmetry to BigDecimal() function with an Integer.
fixes #5098. [ruby-dev:44210]
* ext/bigdecimal/lib/bigdecimal/util.rb (BigDecimal#to_d): added
for adapting other Numeric subclasses. [ruby-dev:44245]
* test/bigdecimal/test_bigdecimal_util.rb: add tests for the above
changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
for symmetry to BigDecimal() function with an Integer.
fixes #5098. [ruby-dev:44210]
change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e