When the integer type is too long, it is represented by the long type;
int = 109098098080800980; int means -2^31 to 2^31-1 long = 109098098080800980; long means -2^63 to 2^63-1
Note that assignment from int
to long
type is valid because int
all values stored in a variable can be stored in long
a variable of type. However, it is not necessarily the case, because the long
type data is larger than the int
type range. So you can't simply long
assign the value stored in the variable to the int
variable. There is a possibility of value overflow.
Reprinted in: https://my.oschina.net/hellation/blog/3023294