Any reason why c
shouldn't equal 0.321?
>>> from math import ceil
>>> a = 123.321
>>> b = a % 60
>>> b
3.320999999999998
>>> ceil(b)
4.0
>>> c = ceil(b) - b
>>> c
0.679000000000002
Update:
For anyone wanting to know how I got the value I was looking for:
>>> c = b - floor(b)
You're going to facepalm in about five minutes :P
ceil(b) is 4.0
b is 3.320999999999998
So ceil(b) - b should be 4.0 - 3.320999999999998
. Try putting that in your calculator and you'll see why c isn't equal to 0.321.
If you're trying to get c equal to .321, you should probably do b - floor(b).