codingdebugging
Why can 0.1 plus 0.2 differ from 0.3?
Anonymous
Many decimal fractions have no exact representation in binary floating point. The stored values are approximations, so arithmetic can produce a nearby result rather than an exact decimal value. For exact decimal quantities, use an appropriate decimal representation; for approximate calculations, compare with a tolerance suited to the problem.
0