When a float variable goes out of the float limits, what happens?
Formally, the behavior is undefined. On a machine with IEEE floating point, however, overflow after rounding will result in Inf. The precision is limited, however, and the results after rounding of FLT_MAX + 1 are FLT_MAX. You can see the same effect with values well under FLT_MAX. Try something like: float f1 = 1e20; // … Read more