check if input is integer or float c++ code example
Example: check if float has decimals c++
if (some_float == (int)some_float) {
// decimal part == 0.0 i.e. no fractional part
}
if (some_float == (int)some_float) {
// decimal part == 0.0 i.e. no fractional part
}