Working on how to solve Exercise 2.1 with a "C programming language", on which you need to calculate on a local computer a range of different types, such as char, short, int, etc., but also float and double. Everything except float and double, I watch how overflow occurs, and therefore can calculate max / min values. However, on floats this still doesn't work.
So the question is, why does this code print the same value twice? I thought the second line should print inf
float f = 1.0; printf("%f\n",FLT_MAX); printf("%f\n",FLT_MAX + f);
c floating-point
Vladimir
source share