fork download
  1. require 'bigdecimal'
  2.  
  3. a = BigDecimal.new("1.2")
  4. b = BigDecimal.new("1.0")
  5. c = BigDecimal.new("0.2")
  6.  
  7. puts a - b == c
  8. puts a * 10 - b * 10 == c * 10
Success #stdin #stdout 0s 30336KB
stdin
Standard input is empty
stdout
true
true