i need a method which given a floating point can check whether it is actually an integral value or not. Currently i am using something like this.
bool IsInteger(double dbl)
long lwT = (long)dbl;
double dblT = (double)lwT;
return (LowerDWORD(dblT) == LowerDWORD(dbl) && HigherDWORD(dblT) == HigherDWORD(dbl));
This method happens to consume 50% of my time blaming _ftol2_sse and floor functions.
Is there any better method to do this? Any assembly instruction possibly?