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\";
A concise version of Pepe's answer
bool isWhole(double num) { return num == static_cast(num); }