BigDecimal("123.45") == 123.45.to_d
=> true
Counterexample:
BigDecimal("1.5999999999999996") == 1.5999999999999996.to_d => false
"123.45".to_d
BigDecimal's only lossless API is through strings. It would be nice to have native support for decimals at the parser level:
0d123.45 => BigDecimal("123.45")
BigDecimal("123.45") == 123.45.to_d
=> true