(Digging this up to add some useful information -- I saw the thread under "who's online")

Doug is right. Floating point numbers are mostly never equal a specific value except you set them onto it. Better use a function, that calculates the difference and proves it against a threshold value.

Algorithm:
 Code:
bool fEqual (double f1, double f2) {
	static const double EPSILON = 0.001;
	return((bool)(fabs(f1-f2) <= EPSILON));
}


Last edited by HeelX; 05/04/08 12:21.