From: "adrianomitre (Adriano Mitre)" Date: 2012-09-01T16:33:55+09:00 Subject: [ruby-core:47386] [Backport92 - Backport #6958][Open] buggy BigDecimal#integer? Issue #6958 has been reported by adrianomitre (Adriano Mitre). ---------------------------------------- Backport #6958: buggy BigDecimal#integer? https://bugs.ruby-lang.org/issues/6958 Author: adrianomitre (Adriano Mitre) Status: Open Priority: High Assignee: Category: lib Target version: BigDecimal#integer? always return false, which is wrong in many cases, as shown below. x, y = BigDecimal('1'), BigDecimal('1.0') x.integer? #=> false y.integer? #=> false x == x.to_i #=> true y == y.to_i #=> true # Possible workaround # class BigDecimal def integer? self == self.to_i end end -- http://bugs.ruby-lang.org/