I don't see any "inconsistency". That's just how floating point numbers work!
1) The value - by definition - is seldom "exact"
2) The representation (e.g. from Printing out to a string) can be totally misleading if you try to print out more digits than your value has precision :)
Sample C code
#include <stdio.h>
int
main ()
{
double d = 1.02 + 1.01;
float f = 1.02 + 1.01;
printf ("d=%lf, f=%f\n", d, f);
printf ("d=%25.20lf, f=%25.20f\n", d, f);
return 0;
}
Sample output:
d=2.030000, f=2.030000
d= 2.03000000000000020000, f= 2.02999997138977050000
Excellent article:
Finally, please read this discussion:
The problem is NOT Python, it's NOT C#, it's NOT Javascript.
I assure you :)