Actions
Bug #10569
closedBigDecimal#fix returns a BigDecimal object instead of a Integer
Bug #10569:
BigDecimal#fix returns a BigDecimal object instead of a Integer
Description
According docs (http://www.ruby-doc.org/stdlib-2.1.5/libdoc/bigdecimal/rdoc/BigDecimal.html#method-i-fix): fix method return the integer part of the number. But it's returning a BugDecimal:
a = BigDecimal(7)
=> #BigDecimal:7fb18015e698,'0.7E1',9(27)
a.fix
=> #BigDecimal:7fb180185d38,'0.7E1',9(18)
a.fix.to_i
=> 7
Similar problem happens with frac method.
Updated by jjconti (Juanjo Conti) over 11 years ago
Updated by jjconti (Juanjo Conti) over 11 years ago
Updated by nobu (Nobuyoshi Nakada) over 11 years ago
- Status changed from Open to Rejected
It returns the integer part as a BigDecimal.
Updated by stomar (Marcus Stollsteimer) over 11 years ago
I submitted a patch that clarifies the documentation accordingly, see issue #10576 (and provides some additional improvements).
Actions