因为某些原因,我的代码提高后, OverflowError: cannot convert float infinity to integer
。 我看不出有任何理由为什么它会做到这一点,很少有使用花车,没有使用INF的,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)
但是有1
或2
作品代替1.5
。为什么?
我刚刚注意到代码有点自引用! – tox123 2014-11-23 21:48:35