Name: akC45999 Date: 01/13/97
The Java Virtual Machine, section drem, claims:
If the dividend is an infinity, or the divisor is a zero, or both, the result is NaN.
Meanwhile, following test fails:
--------------------- drem00301.java
package javasoft.sqe.tests.vm.drem.drem003.drem00301;
import java.io.PrintStream;
import java.lang.Double;
public class drem00301
{
public static void main(String argv[])
{
System.exit(run(argv, System.out));
}
public static int run(String argv[], PrintStream out)
{
double negInf = Double.NEGATIVE_INFINITY;
double posInf = Double.POSITIVE_INFINITY;
double negZero = -0.0;
double posZero = +0.0;
double negVal = -3.14;
if (! Double.isNaN(negInf % 3.14))
return 2;
else if (! Double.isNaN(negInf % negVal))
return 2;
else if (! Double.isNaN(negInf % negInf))
return 2;
else if (! Double.isNaN(negInf % posInf))
return 2;
else if (! Double.isNaN(negInf % negZero))
return 2;
else if (! Double.isNaN(negInf % posZero))
return 2;
else if (! Double.isNaN(posInf % 3.14))
return 2;
else if (! Double.isNaN(posInf % negVal))
return 2;
else if (! Double.isNaN(posInf % negInf))
return 2;
else if (! Double.isNaN(posInf % posInf))
return 2;
else if (! Double.isNaN(posInf % negZero))
return 2;
else if (! Double.isNaN(posInf % posZero))
return 2;
else if (! Double.isNaN(negVal % negZero))
return 2;
else if (! Double.isNaN(3.14 % posZero))
return 2;
else if (! Double.isNaN(negZero % negZero))
return 2;
else if (! Double.isNaN(negZero % posZero))
return 2;
else if (! Double.isNaN(posZero % negZero))
return 2;
else if (! Double.isNaN(posZero % posZero))
return 2;
return 0;
}
}
---------------------
======================================================================