// this function tests if two floating-point values are equal
#define EPSILON 0.00001f
inline bool IsSame(float f1, float f2)
{
return fabs(f1-f2) < EPSILON;
}
// this function tests if a floating-point value is lower than another
inline bool IsLowerThan(float f1, float f2)
{
return (f2-f1) > EPSILON;
}
// this function tests if a floating-point value is lower than or equal to another
inline bool IsLowerThanOrEqual(float f1, float f2)
{
return (f1-f2) <= EPSILON;
}
// this function tests if a floating-point value is greater than another
inline bool IsGreaterThan(float f1, float f2)
{
return (f1-f2) > EPSILON;
}
// this function tests if a floating-point value is greater than or equal to another
inline bool IsGreaterThanOrEqual(float f1, float f2)
{
return (f2-f1) <= EPSILON;
}
#undef EPSILON
what about the fast floating-point model? Do I need the above functions if I use the fast floating-point model?
P.S.: I really don't know much about the floating-point model...:huh: sorry if it doesn't have to do with my functions. :wacko:
Thanks












