I have a simple C++ program compiled using gcc 4.2.4 on 32-bit Ubuntu 8.04. It has a for-loop in which a double variable is incremented from zero t
for
double
Most exact decimals do not have an exact finite representation in floating point arithmetic.
You need to read Goldberg's What Every Computer Scientist Should Know About Floating-Point Arithmetic.