From: "marcandre (Marc-Andre Lafortune)" Date: 2013-12-10T03:42:42+09:00 Subject: [ruby-core:59001] [ruby-trunk - Bug #9192][Open] Inconsistent comparison between Float and BigDecimal Issue #9192 has been updated by marcandre (Marc-Andre Lafortune). Status changed from Closed to Open Hi 1) I disagree with this change. Is it possible to know why you decided to ignore my recommendation without even commenting on it? 2) The implementation is buggy. For example: BigDecimal('0.21611564636388508') == 0.21611564636388508 # => false, should be true ---------------------------------------- Bug #9192: Inconsistent comparison between Float and BigDecimal https://bugs.ruby-lang.org/issues/9192#change-43554 Author: vatsu (Gustavo Sales) Status: Open Priority: Normal Assignee: mrkn (Kenta Murata) Category: ext Target version: ruby -v: 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin11.4.2] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN I was checking a possible inconsistency on ActiveModel and I found situations where comparing BigDecimal to Float differs to comparing Float to BigDecimal. I have create a simple ruby script to exemplify the problem. The script is attach to this issue and output is as follows: Instance number 706.05 ########### Instance number 706.06 Inconsistence: 0.70606E3 > 706.06 706.06 < 0.70606E3 ========= Inconsistence: 0.70606E3 <= 706.06 706.06 >= 0.70606E3 ========= ########### Instance number 706.07 Inconsistence: 0.70607E3 < 706.07 706.07 > 0.70607E3 ========= Inconsistence: 0.70607E3 >= 706.07 706.07 <= 0.70607E3 ========= ########### Instance number 706.08 ########### -- http://bugs.ruby-lang.org/