K
Kevin
Hello:
I have a couple mathematical expressions built into my database (in forms
and in queries) and I notice that I get some strange results sometimes. I'll
give a couple rows from a query which typifies my question:
Var1 Var2 Var3: [Var1] - [Var2]
0.8 1 -0.199999988079071
0.8 0.9 -9.99999642372131E-02
1.1 1.2 -0.100000023841858
Obviously, Var3 for the above three rows ought to be exactly -0.2, -0.1, and
-0.1. In my other examples, I get similar results where it is 'real' close to
the correct answer, but just off by some miniscule amount. I get the same
results with another expression (on a form) where it is addition instead of
subraction.
Of note, Var1 and Var2 in this example are both being stored as a Single
since I need them to be decimals.
Very weird. What could I be doing wrong?
Thanks!
I have a couple mathematical expressions built into my database (in forms
and in queries) and I notice that I get some strange results sometimes. I'll
give a couple rows from a query which typifies my question:
Var1 Var2 Var3: [Var1] - [Var2]
0.8 1 -0.199999988079071
0.8 0.9 -9.99999642372131E-02
1.1 1.2 -0.100000023841858
Obviously, Var3 for the above three rows ought to be exactly -0.2, -0.1, and
-0.1. In my other examples, I get similar results where it is 'real' close to
the correct answer, but just off by some miniscule amount. I get the same
results with another expression (on a form) where it is addition instead of
subraction.
Of note, Var1 and Var2 in this example are both being stored as a Single
since I need them to be decimals.
Very weird. What could I be doing wrong?
Thanks!