Win32 only: Converting Double.MAX_VALUE to a long returns Long.MIN_VALUE, it
should return Long.MAX_VALUE
Steps to reproduce
Compile and run the attached code
See bugs 1240807 & 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 );
}
}
should return Long.MAX_VALUE
Steps to reproduce
Compile and run the attached code
See bugs 1240807 & 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-1240807 Win32 only: Converting Double.MAX_VALUE -> integer returns 0
-
- Closed
-