check a number if decimal in 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
}