这一定非常明显,但我目前正在做一个具有以下代码片段的小教程:
n=0 a=1 while a>0: n=n+1 a=(1.0+2.0**(-n))-1.0 print (n)
我试图运行它但它仍然卡在n = 53.为什么?我只是假设while永远是真的......
while
python floating-point floating-accuracy python-3.x
floating-accuracy ×1
floating-point ×1
python ×1
python-3.x ×1