This would only happen if the value were a "narrowing conversion," where a value exceeded the possible range value allowed in the new type, such as trying to convert from long to int, for example.
只有当一个值 “转换为范围更小的类型” 时,即这个值超出了新类型允许的范围,例如试图从 long 类型转换为 int 类型,才会发生这样的情况。
This is distinguished from a narrowing conversion, which may lose data.
这与收缩转换不同,后者可能丢失数据。
An example of a narrowing conversion is converting a 64-bit signed integer to a 32-bit signed integer.
缩小转换的范例是转换64位元带正负号的整数为32位元带正负号的整数。
应用推荐