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?
Two types with the same size in bytes can have different ranges for sure.
For example, signed int and unsigned int are both 4 bytes, but one has one of its 32 bits reserved for the sign, which lowers the maximum value by a factor of 2 by default. Also, the range is different because the one can be negative. Floats on the other hand lose value range in favor of using some bits for decimal range.