What is wrong with this picture: >>> x = 500000000.0 >>> y = x / (1024 * 1024) >>> y 476.837158203125 >>> z = round(y, 2) >>> z 476.83999999999997 Obviously, '476.83999999999997' is not rounded to two decimal places. Or am I doing something wrong?