>> it's not necessary to worry when comparing x and floor(x) if it is necessary to detect that a floating point variable x holds an integral value.
What about my example? It gives incorrect output.
>> it's not necessary to worry when comparing x and floor(x) if it is necessary to detect that a floating point variable x holds an integral value.
What about my example? It gives incorrect output.
As a matter of fact, it gives correct output. Your code correctly detected that a floating point variable with the value (approximately) 42.993 does not contain an integral value.
Your error was in expecting that the series of calculations that produced the value would yield an integral value.