Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels