I have a question about the ranges of ints and floats:
If they both have the same size of 4 bytes, why do they have different ranges?
An integer is just a number... It's range depends on the number of bits (different for a signed or unsigned integer).
A floating point number is a whole different thing. It's just a convention about representing a floating point number in binary...
It's coded with a sign bit, an exponent field, and a mantissa.
Read the following article:
http://www.eosgarden.com/en/articles/float/
It will make you understand what are floating point values, from a binary perspective. The you'll understand the range thing...