how to check if the decimal part of a float is zero 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
}