For some reason after a while my code raises,
OverflowError: cannot convert float infinity to integer
.
I can't see any reason why it would do this, there is little use of floats and no use of the inf,
def bugsInCode(begin):
bugs = begin
while bugs != 0:
print "%s bugs in the code, %s bugs\ntake one down patch it around, %s bugs in the code!" % (bugs, bugs, int(bugs * 1.5))
bugs = int(bugs * 1.5)
However replacing 1.5
with a 1
or a 2
works. Why?