check if number is float or int cpp 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
}