1
is int
type, why short s = 1
does not report an error, while 1.1
is double
type float f = 1.1
?
1
is int
type, why short s = 1
does not report an error, while 1.1
is double
type float f = 1.1
?
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.
Previous: How to generate reverse fillet by css
Next: Wechat's public platform test account "errcode": 50002 "errmsg": "user limited hint"
Why {} + [] = 0? in the case of parameters on both sides of the operator as objects, {} + [] = = [object Object] , but the result returned under the console is 0. has searched for such problems, saying that {} is treated as a block-level scope, and...
I know there is no Long type in JavaScript, but how can I convert the corresponding bytes bytecode to Long type? Here is a piece of java code that can be easily converted in java, such as byte [] a = {0x02,0x03, 0x04, 0x05, 0x06,0x07, 0x08, 0x09}; publ...