Project

General

Profile

Actions

Bug #5098

closed

bigdecimal/util.rb で定義される to_d メソッドによる型変換と、BigDecimal 関数による型変換が整合していない

Added by mrkn (Kenta Murata) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.4dev (2011-07-17 trunk 32564) [x86_64-darwin10.8.0]
Backport:
[ruby-dev:44241]

Description

BigDecimal() および BigDecimal#coerce との関係より、以下のように修正が必要。

  • Float#to_d はオプショナルな精度を受け付けるように変更し、精度が省略された場合は Float::DIG が指定されたものとする。
  • Rational#to_d は精度を必須とする。
  • Integer#to_d を追加する。
Actions #1

Updated by mrkn (Kenta Murata) over 12 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r32677.
Kenta, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • ext/bigdecimal/lib/bigdecimal/util.rb (Integer#to_d): added
    for symmetry to BigDecimal() function with an Integer.
    fixes #5098. [ruby-dev:44210]
  • test/bigdecimal/test_bigdecimal_util.rb: add test for the above
    change.
Actions

Also available in: Atom PDF

Like0
Like0