Invalid Results of Addition & Subtraction

J

JAB

1-1 = .00000000003456154x10-100

Every time I do math it seems there is a difference of
..00000000000000000000000000001 even when these are the same fields.

Thanks,
 
J

JAB

Thanks for the reply, I actually created a more in-depth post today, since i
was not able to locate this one. Bottom line. Number Field (Single, 2
Decimal Places) Exact Value: 1041.73 When placed in Query FieldA =
1041.72998046875, but as Expr3: [FieldA] = 1041.73

Issue Located: Field (Single, 2 Decimal Places) Field set to format as
currency. This causes 1041.73 to caculate and display as 1041.72998046875.

I am not sure how this relates to Floating Point's. I might not fully
understand Floating-point Numbers, but I have attempted to adjust all the
fields to Double's this has cause all the data to show as 1041.72998046875
then I rounded this off to 2 decimal points and hope I don't lose any pennies.

Thanks Again
 
A

Allen Browne

I see that Douglas Steele has given you a similar answer in your later post.

Doubles *are* floating point numbers. Just because you asked for 2 decimal
places of *display* does not give you 2 decimal places of stored precision.

You can store the value 1041.73 exactly in a Currency field, since it is a
fixed point type.

You can also store it precisely in a Decimal field, but I can't recommend
using that type as JET does not handle it reliably.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

JAB said:
Thanks for the reply, I actually created a more in-depth post today, since
i
was not able to locate this one. Bottom line. Number Field (Single, 2
Decimal Places) Exact Value: 1041.73 When placed in Query FieldA =
1041.72998046875, but as Expr3: [FieldA] = 1041.73

Issue Located: Field (Single, 2 Decimal Places) Field set to format as
currency. This causes 1041.73 to caculate and display as
1041.72998046875.

I am not sure how this relates to Floating Point's. I might not fully
understand Floating-point Numbers, but I have attempted to adjust all the
fields to Double's this has cause all the data to show as 1041.72998046875
then I rounded this off to 2 decimal points and hope I don't lose any
pennies.

Thanks Again

Allen Browne said:
 
Top