Why does short s = 1 not report an error?

1 is int type, why short s = 1 does not report an error, while 1.1 is double type float f = 1.1 ?

Mar.28,2021

because if the int exceeds the short range, the lower part will be truncated, and if the value is not exceeded, it will be assigned normally.

but the double type is unpredictable, and perhaps very simple numbers are full of bytes, such as 0.5, which is actually expressed in memory as: 0.499999999999
. This is obviously not allowed. So the float assignment decimal must be marked so that the editor can check it during compilation.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3163a-2bd98.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3163a-2bd98.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?