Number / Currency Field 1041.73 becomes 1041.72998046875 in query.

J

JAB

Actually Data in a Single number field is 1041.73 (Entered in manually in
this amount). If I perform any mathematical function on this field, the
value because 1041.72998046875. If I create a query with this field, the
value becomes 1041.72998046875, but if i create the expression Expr1:
[FieldA] the value is correct at 1041.73. I was wondering if this could be a
bad Processor?

MS Access 2000 SR 1
 
D

Douglas J. Steele

It's a fact of life using floating point numbers on computers.

Rather than using a Single, try using a Currency field.
 
B

Brent Spaulding \(datAdrenaline\)

Expanding brief and incredibly accurate reply, here is an expansion on Float
vs Fixed numbers (cut from a post of mine on www.utteraccess.com) ....

With floating point numbers, there really is no Zero ... all numbers are
just as close of an approximation that can be atained with a bunch of 1's
and 0's. So the larger the number the more inaccurate the right side of the
decimal becomes ... note the range of a "Double" numeric type:

-1.79769313486231E308 to -4.94065645841247E-324 for negative values and from
4.94065645841247E-324 to 1.79769313486232E308 for positive values.

Note .. there is no Zero in there!! ... that is because the computer uses a
certain number of bits for the left of the decimal and a certain number of
bits for the right of the decimal and the number of bits used to represent
each side can varies with the value being stored! So each bit increment with
a floating point value is a "computer unit" that may not correspond to "1",
"0.01", "0.0001" ... etc ... with FIXED POINT and WHOLE NUMBERS, its easy
because the "scale" of each bit increment is fixed, a specified number of
bits is dedicated to the left and right of the decimal... AND .. there is a
TRUE representation of Zero (all bits are 0).


--
Brent Spaulding | datAdrenaline | Access MVP

Douglas J. Steele said:
It's a fact of life using floating point numbers on computers.

Rather than using a Single, try using a Currency field.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


JAB said:
Actually Data in a Single number field is 1041.73 (Entered in manually in
this amount). If I perform any mathematical function on this field, the
value because 1041.72998046875. If I create a query with this field, the
value becomes 1041.72998046875, but if i create the expression Expr1:
[FieldA] the value is correct at 1041.73. I was wondering if this could
be a
bad Processor?

MS Access 2000 SR 1
 
Top