Simple subtraction?

Hi all!

I have a simple subtraction and didnt get the result is want!

Here is the code:

Dim a As Double

Dim b As Double

Dim x As Double

a = 48.19

b = 48.18

x = a-b

Msgbox cstr(x)

I want to get the result 0,01

but

the result is: 9,999999999801E-03

Where is the mistake?

Thanks for your support!

andi.f

Subject: Simple subtraction?

There is no mistake. Computers work with binary data, and most simple decimal fractions have no exact binary equivalent. In this case you might be happier if you use Currency instead of Double.

Subject: RE: Simple subtraction?

Thank You Rod!

I made the mistake, that i used double for finance calculations!