irb(main):013:0> require 'bigdecimal'
=> false
irb(main):014:0> 10.times.inject(0.0) {|i, _| i + 0.1 }.to_i
=> 0
irb(main):015:0> 10.times.inject(BigDecimal("0.0")) {|i, _| i + BigDecimal("0.1") }.to_i
=> 1
Created
October 23, 2019 06:00
-
-
Save kenchan/39d2722bb328eae6b3371745e73e5dce to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment