A variable's size depends on its type, not on its value.
Two float
variables will always be the same size, regardless of the value stored in them.
Notice that you can do e.g.:
float a;
float b;
if(sizeof a == sizeof b)
printf("a and b have the same size\n");
The above is valid even if, as shown, the variables' values are undefined. This is because sizeof
can be evaluated at compile-time, and thus not depend on the actual values at all. This is another proof that the value does not affect the size of the variable.