Floats are not like integers. Results of formulas rarely equal 0.0, so use something like this:
PHP Code:
#define FLOAT_ZERO 0.0001 //anything lower than this is considered 0.0
if(-FLOAT_ZERO <= floatX <= FLOAT_ZERO)
{
floatX = 1.0;
}
__________________