Generally speaking, the storage space occupied by int variables is as large as machine words, which is 4 bytes in a 32-bit system; 8 bytes in a 64-bit system; However, double variables generally occupy 8 bytes, and double variables occupy no less storage space than int variables.
The range of values represented by double type is larger than that represented by int, and the conversion from double value to int value will be rounded, resulting in loss of accuracy.