[AccessD] Single vs. double issue...

Heenan, Lambert Lambert.Heenan at AIG.com
Fri Mar 17 14:17:28 CST 2006


The difference between Single and Double is not just the number of decimal
places, but also the range of values to the left of the decimal point.

A Single can store -3.402823E38 to -1.401298E-45 for negative values and
from 1.401298E-45 to 3.402823E38 for positive values. 

A Double can store -1.79769313486231E308 to -4.94065645841247E-324 for
negative values and from 4.94065645841247E-324 to 1.79769313486232E308 for
positive values. 

That's the official word. I just tested what you report and can confirm that
singles in a table are doing this very strange 'rounding'. It also happened
when you use Single type variables in code. It makes no sense at all to me
as 666,656,666 is only ~6.66E8, well within the supposed range of a Single.

So at first blush this is a VERY SERIOUS bug in the Single data type!!!!!!!

Anyone care to ring the bell at M$?

Lambert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bobby Heid
Sent: Friday, March 17, 2006 2:54 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Single vs. double issue...


Hey,

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.

Normally, I store decimal values as double.  But for some reason, this
particular field was set to single.  Our client found an issue with that
field today.  They had entered 666,656,666 into the field.  When you look at
the table, it is 666,656,600.

As a test, I changed the field to double, entered 666,656,666, and saved it.
The value stuck.  Then I changed it to single, got the smaller field size
warning, and saved it.  When I looked at the table, the value was
666,656,600.

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?

Thanks,
Bobby

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list