BigDecimal to_s does not match to_f
- by Chris Bisignani
Is the BigDecimal class broken? It seems like the following should never, ever occur:
Note that a.to_f != a.to_s.to_f
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
=…