This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

float substraction error

Has anyone had any problems substracting floats? I have the following code:
(C166 V4.23 compiler)

float dummy, test1, test2;

test1 = 1.0e10;
test2 = 1.1e10;
dummy = test2 - test1;

for some reason dummy comes out as
1.000001e9

I've tried declaring them as doubles and get the same result.


DS