[AccessD] Single vs. double issue...

Josh McFarlane darsant at gmail.com
Fri Mar 17 19:02:32 CST 2006


On 3/17/06, Bobby Heid <bheid at appdevgrp.com> wrote:
> I always thought that the main difference between a single and a double was
> that the single had 7 digits  and the double had 15 digits of precision
> AFTER the decimal point.
>
> So, I think the issue is that I misunderstood what the precision meant in
> the single vs. double declaration.  I wanted to be sure that this was the
> issue before I just blindly convert them to doubles.  Am I correct?

Think significant figures and it might make more sense:

Basically 666,656,666 can also be represnted as 6.66656666 x 10^9,
which is typically how it's stored in floating point numbers (two
parts, the first part, and then the exponent), so you end up with
6.666566 x 10 ^ 9 as you saw.

Due to the number of bytes used to store the value, certain amounts
will be rounded to the nearest possible precision value, as you can
only represent so much data in the space provided for the first part.

You've really got two seperate bounds on the numbers:

One for the exponent on the base 10, and the one for the multiple. For
single it's about 7 significant digits as you said. When you go up to
a double, you get a bigger range for both values.

So, while it may be misleading to say that singles have a range form
some number to negative some number, there are various values in
between that cannot be accurately represented by the single / double
precision because you have two many significant figures.

--
Josh McFarlane

"Peace cannot be kept by force. It can only be achieved by understanding."
-Albert Einstein



More information about the AccessD mailing list