Is the BigDecimal class broken? It seems like it should never happen: Note that a.to_f! = A.to_s.to_f
class A.class => BigDecimal
a.to_f => 18658.1072928
a.to_s => "10865.81072928"
b.class => BigDecimal
b.to_f => 10000.0
b.to_s => "10000.0"
(a - b) .to_f => 865.81072928
a.to_f - b.to_f => 8658.1072928
Any ideas on what could go wrong? We run ruby 1.8.7p72 on our servers and 1.8.7p173 on our local machines.
source
share