Any thoughts as to that for which I had not accounted here?
Looks like it returns 99.99999999999999
using ruby 2.3.1p112
Any thoughts as to that for which I had not accounted here?
Looks like it returns 99.99999999999999
using ruby 2.3.1p112
This was discussed million times - to have precise calculations one must use decimal data type, which in Ruby is represented by BigDecimal
class:
BigDecimal(110)/1.1 == 100
#=> true