So this just wasted a couple of hours of mine in debugging..
a,b = 32980.642295,32630.642295
print a-b
print int(a-b)
print int(a) - int(b)
Output :
350.0
349
350
Can someone explain to me what is going on? Why wouldn't the int of 350.0 just be 350? I assume python is doing some weird stuff in casting a and b before converting to int..
EDIT/ Update :
x = a-b
Value stored in x is now 349.99999999999636 not 350.0
This might help future people coming to the post Is floating point math broken?