Hi cybertor,
This is normal behavious of binary based floating point variables.
They are only rounded to the value you want.
You might try using decimal variables instead.
--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
"cybertof" <cy****************@gmx.net> wrote in message
news:MP***********************@msnews.microsoft.co m...
Hello,
I have the strange beeing :
float f1 = 108.88F;
float f2 = 111.11F;
float f3 = f1 - f2;
double d1 = 108.88;
double d2 = 111.11;
double d3 = d1 - d2;
f3 contains -2.23000336
d3 contains -2.230000000000004
instead of -2.23.
Am i missing something ?
Regards,
Cybertof.