Bug #9191
Inconsistent comparison between Float and BigDecimal
Status:
Closed
Priority:
Normal
Assignee:

Target version:

ruby v:
2.0.0p353 (20131122 revision 43784) [x86_64darwin11.4.2]
Backport:
Description
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
###########
Associated revisions
 numeric.c: Mention that Float::DIG is the minimum number of siginificant digits. See #9191
 numeric.c: Mention that Float::DIG is the minimum number of siginificant digits. See #9191
 numeric.c: Mention that Float::DIG is the minimum number of siginificant digits. See #9191
 numeric.c: Mention that Float::DIG is the minimum number of siginificant digits. See #9191
 numeric.c: Mention that Float::DIG is the minimum number of siginificant digits. See #9191
History
#1 [rubycore:58759] Updated by hsbt (Hiroshi SHIBATA) over 4 years ago
 Status changed from Open to Closed
duplicated #9192
gitsvnid: svn+ssh://ci.rubylang.org/ruby/trunk@45235 b2dd03c839d44d8f98ff823fe69b080e