Strange values when summing in a query

  • Thread starter Thread starter Kjell Harnesk
  • Start date Start date
K

Kjell Harnesk

Why is it that a query in Access resturns strange values when summing simple
figures.
Example: I have a number of records with a number field values like 8 7.5
6 8 12 9.3 and so on.
When I make a query that sums these fields the correct sum may be 269.3 but
in the query is says 263.30000000013
or something like that.
 
It's floating point round-off error.

Just as humans can't represent certain fractions exactly in base 10 (think,
for example, 1/3, which is 0.333333 repeating), so too computers can't
represent certains fractions exactly in base 16. There's an entire branch of
computer science call numerical methods (or numerical analysis) devoted to
the study of how to reduce round-off error.
 
Back
Top