mysql数字列表的简单精度问题不能计算与单个计算相同的和。 (如何处理这个事件?)有一(1)分的差异?
行样本:
Select qty, (qty*21.25)
6.5 | 138.125
0.5 | 10.625
0.5 | 10.625
0.25 | 5.3125
1 | 21.25
2 | 42.5
1 | 21.25
2 | 42.5
2.5 | 53.125
2.5 | 53.125
2 | 42.5
3 | 63.75
3 | 63.75
3.5 | 74.375
样本2:
Select sum(qty), sum(amount)
30.25 | 642.8175
样本3:
Select 30.25*21.25
642.8125
Since the answer was so vague. Let try this. Can anyone explain why the mysql statement produces the wrong results.
SELECT 6.875+3.125
10.00
Shouldn't this be
10.01