double vX, vY, vRez;vX=1.0;vY=10.0;vRez=vX/vY;
long double vX;vX=0.1;
if (fabs(a - b) < 1e-6){ return true;}esle return false;
qFuzzyCompare ( double p1, double p2 ) [static]
// Instead of comparing with 0.0 qFuzzyCompare(0.0,1.0e-200); // This will return false // Compare adding 1 to both values will fix the problem qFuzzyCompare(1 + 0.0, 1 + 1.0e-200); // This will return true
if (vStep!=10.0) { vStep=1.0/vStep; } else { vStep=1.0e-1; }
float t = 1.0f;t /= 10;...if (t == 0.1f) { // вернет true...}