I was preparing a code for my friend and I stumbled upon this interesting bug/feature. See the source and output below and can someone explain to me, why does it add more than 0.001 to the current_time var?
Source:
import time
current_time = 0.000
check = input("Ready to go?")
while True:
current_time = current_time+0.001
print(str(current_time)+" s")
time.sleep(0.001)
Output:
Ready to go?
0.001 s
0.002 s
0.003 s
0.004 s
0.005 s
0.006 s
0.007 s
0.008 s
0.009000000000000001 s
0.010000000000000002 s
0.011000000000000003 s
0.012000000000000004 s
Thanks in advance!