Number accuracy

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

Guest

I would appreciate anyone's comments about this issure. I have a field
within a table called "Weight" the field type is number and I selected
single for the field size. I am entering numbers as follows 0.4, 1.2, 2.5,
..5 etc. Well, when I went to do a query I calculated each number by 1 and it
gave me this! What are the extra numbers???? I only entered .6, and did not
enter 0.600000023841858. Please help!

0.600000023841858 Number entered = 0.6
0.300000011920929 Number entered = 0.3
0.400000005960464 Number entered = 0.4
0.300000011920929 Number entered = 0.3
0.200000002980232 Number entered = 0.2
 
Welcome to the world of floating point numbers on computers!

Just as there are certain fractions that we can't reproduce exactly in Base
10 (think one third or five sixths, for instance), so too are there numbers
that computers can't represent exactly in Base 2.

If it's an issue, try using Currency or Decimal, rather than Single or
Double.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top