This is not a problem of your code, its more a problem of your understanding of floats.
Maybe this helps:
http://stackoverflow.com/questions/2100490/floating-point-inaccuracy-examples
This is not a problem of your code, its more a problem of your understanding of floats.
Maybe this helps:
http://stackoverflow.com/questions/2100490/floating-point-inaccuracy-examples