如何在 python 中打印一个简单操作的完整浮点结果?我的代码是:
if( int(array_Y[counter2]) == int(round(float(elem[0])))):
if(int(round(float(elem[0]))) == 0):
negatiu_verdader += 1
if(int(round(float(elem[0]))) == 1):
positiu_verdader += 1
counter = counter + 1
counter2 = counter2 + 1
error = float(1.0000- (1.0000 * counter / counter2))
print " ERROR!!!!!!!!!!!!!!!!!!!!!!!! :" + ("{0:.15f}".format(round(error,2)))
但错误总是:0.420000000000000
或者0.230000000000000
但我希望错误是:0.43233213213232
。