Code:
float f = whatever;
if (fmod (f, floor (f)) == 0)
    // f is a whole number
...