You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be an issue when a cast is performed from a floating-point number that is larger than the maximum Integer to an Integer. In this case, the value should just be the largest Integer as documented in Section 5.1.3 of the JLS.
However, K-Java performs this cast in the same way as a long to int cast as illustrated by the following example.
System.out.println(((int)2147483648L));
System.out.println(((int)2147483648.0)); // should be 2147483647
The same issue also occurs for a cast to other data types when floating-point numbers are involved.
The text was updated successfully, but these errors were encountered:
There seems to be an issue when a cast is performed from a floating-point number that is larger than the maximum Integer to an Integer. In this case, the value should just be the largest Integer as documented in Section 5.1.3 of the JLS.
However, K-Java performs this cast in the same way as a long to int cast as illustrated by the following example.
The same issue also occurs for a cast to other data types when floating-point numbers are involved.
The text was updated successfully, but these errors were encountered: