Floating-Point Precision in Ruby: Why 0.1 + 0.33 ≠ 0.43
Ruby's 0.1 + 0.33 does not equal 0.43 because of binary floating-point rounding, and Rational, BigDecimal, and tolerance comparisons each fix it differently.
Ruby's 0.1 + 0.33 does not equal 0.43 because of binary floating-point rounding, and Rational, BigDecimal, and tolerance comparisons each fix it differently.