I need to check if a variable is a whole number, say I have the code:
double foobar = 3; //Pseudocode if (foobar == whole) cout << \"It\'s whole\";
Assuming foobar is in fact a floating point value, you could round it and compare that to the number itself:
foobar
if (floor(foobar) == foobar) cout << "It's whole"; else cout << "Not whole";