Calculations

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I rounded several numbers to two decimals then copies and pasted the values,
not the function. When I sum the numbers, the answer should be zero but but
the sum is -2.27373675443232E-13. I thought rounding and pasting the values
would get rid of the these types of errors.
 
If no number has more than 2 decimal places and you are only
adding/subtracting, then you can round the final result to 2 decimal places
without violence to the calculation.

Computers work in binary. In binary, most terminating decimal fractions are
non-terminating binary fractions that can only be approximated (just as 1/3
can only be approximated as a decimal fraction). Since the inputs are only
approximately what you intended, it should be be no surprise when their sum
is only approximately what you intended. For example =(0.3-0.2-0.1) will
return -2.8E-17 instead of zero, due to the fact that all three decimal
fractions must be approximated. The approximations used by Excel (and almost
all other general purpose software) follow the IEEE 754 standard for double
precision.

Jerry
 
Back
Top