Floating-point values approximate real numbers because computers allocate only a limited number of bits to represent them. Most real numbers therefore cannot be expressed precisely, even when the printed result looks familiar. section 12.8
A common mistake is comparing floating-point results with operator==. Dividing 100.0 by 3 produces a value close to 33.3333333333, but not necessarily that exact value, so direct equality can unexpectedly return false. Compare the difference with a suitable epsilon instead. section 12.8
Make conversion explicit
A Rational object can be converted to double for comparison, but the conversion may hide imprecision and invite a misleading equality test. Replace an implicit conversion operator with a named toDouble function so the conversion is visible and type mismatches remain easier to notice. Even then, avoid operator== for floating-point comparisons. section 9.7



















