Project

General

Profile

Actions

Bug #10569

closed

BigDecimal#fix returns a BigDecimal object instead of a Integer

Added by jjconti (Juanjo Conti) almost 7 years ago. Updated almost 7 years ago.

Status:
Rejected
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin13.0]
[ruby-core:66689]

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)
=> #
a.fix
=> #
a.fix.to_i
=> 7

Similar problem happens with frac method.

Actions

Also available in: Atom PDF