never try to do an equals compare
double da,db;
...
if (da==db) then something.
remember that C uses double by default so if you want to do single precision, be clear about it
float fa,fb;
...
fa = fb + 1.0;
will convert fb to double do a double add then convert to single and do a single equal
Instead
fa = fb + 1.0F.
all single.
If you are going to use a whole number like 1.0 dont make it a decimal in your code. you get more reliability out of your compilers/tools if you can minimize the ascii numbers. so
fa = fb + 1;
or instead of
fa = fb + 0.3333333F;
do something like this (if interested in accuracy).
fc = 1;
fc = fc / 3;
fa = fb + fc;
Lots and lots of others, floating point is painful, compilers and libs are not that good, fpus have bugs, and IEEE is exceptionally painful and leads to more bugs. Unfortunately that is the world we live in on most platforms.