Saturday 1 October 2016

python - Limiting floats to two decimal points

I want a to be rounded to 13.95.




>>> a
13.949999999999999
>>> round(a, 2)
13.949999999999999


The round function does not work the way I expected.

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...