Java中的准确性问题
To add 0.01 + 0.02 + ... + 1.00, what order should you use to add the numbers to get better accuracy?
a. add 0.01, 0.02, ..., 1.00 in this order to a sum variable whose initial value is 0.
b. add 1.00, 0.99, 0.98, ..., 0.02, 0.01 in this order to a sum variable whose initial value is 0.
(想知道答案和原因,求大佬指教)