我有以下公式:
SZT = SZ0 + (((SZ1 - SZ0) / (WMZ1 - WMZ0)) * (WMZT - WMZ0))
示例:
86266 + (((168480 - 86266) / (703786 - 510531)) * (703765.0 - 510531))
当我使用python解释器(2.7.6)进行此计算时,得到以下结果:
86266
当我使用计算器(例如谷歌)时,我得到以下结果:
168471.066239
我假设第二个是正确的结果。你知道吗
Python中的计算有什么问题?你知道吗
Tags:
基本上
Python 2.7
和3.3
的计算是不同的。你知道吗python3.3为
1/10
返回0.1
,而python2.7返回0
。可以使用__future__
启用新的除法运算符它与python版本和division操作符有关
示例:
使用2.7:
使用python 3.3:
相关问题 更多 >
编程相关推荐