Assuming signed integers and the IEEE floating point format, the values of the integers that can be represented are:
short -> 15 bits
float -> 23 bits
long -> 31 bits
double -> 52 bits
Therefore, a floatcan represent any short, and a doublecan represent any long.
source
share