Win32 only: Converting Double.MAX_VALUE to an integer returns 0, it should return
Integer.MAX_VALUE
Steps to reproduce
Compile and run the attached code
See Bugs 1240810, 1229191
public class JavaConvert
{
public static void main (String args[])
{
// conversion from double to integer and long
System.out.println();
System.out.println("double to integer and long");
double d = Double.MAX_VALUE;
int i = (int)d;
long pl = (long)d;
System.out.println( "d = " + d );
System.out.print( "i = " + i );
System.out.println(" Should be: " + Integer.MAX_VALUE );
System.out.print("pl = " + pl );
System.out.println(" Should be: " + Long.MAX_VALUE );
}
}
Integer.MAX_VALUE
Steps to reproduce
Compile and run the attached code
See Bugs 1240810, 1229191
public class JavaConvert
{
public static void main (String args[])
{
// conversion from double to integer and long
System.out.println();
System.out.println("double to integer and long");
double d = Double.MAX_VALUE;
int i = (int)d;
long pl = (long)d;
System.out.println( "d = " + d );
System.out.print( "i = " + i );
System.out.println(" Should be: " + Integer.MAX_VALUE );
System.out.print("pl = " + pl );
System.out.println(" Should be: " + Long.MAX_VALUE );
}
}
- relates to
-
JDK-1240810 Win32 only: Converting Double.MAX_VALUE -> long returns Long.MIN_VALUE
-
- Closed
-