-2
在C#總結小數
(18761311001m * 0.36m +
18761311001m * 0.35m +
18761311001m * 0.29m)
/66.1445m
= 283641285.38276047139217924393
但
((18761311001m * 0.36m)/66.1445m) +
((18761311001m * 0.35m)/66.1445m) +
((18761311001m * 0.29m) /66.1445m)
= 283641285.38276047139217924392
任何人都知道爲什麼區別,以及如何得到兩個相同的答案?
感謝
可能重複[浮點數學是否被破壞?](http://stackoverflow.com/questions/588004/is-floating-point-math-broken) – Liam
此外[爲什麼C#中的浮點數算法不精確?] (http://stackoverflow.com/questions/753948/why-is-floating-point-arithmetic-in-c-sharp-imprecise) – Liam
什麼是你的應用程序在哪裏做sextillionth會有所作爲? –