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:
--------------------- drem00101.java
package javasoft.sqe.tests.vm.frem.frem003.frem00301;
import java.io.PrintStream;
import java.lang.Float;
public class frem00301
{
public static void main(String argv[])
{
System.exit(run(argv, System.out));
}
public static int run(String argv[], PrintStream out)
{
float negInf = Float.NEGATIVE_INFINITY;
float posInf = Float.POSITIVE_INFINITY;
float negZero = -0.0f;
float posZero = +0.0f;
float negVal = -3.14f;
if (! Float.isNaN(negInf % 3.14f))
return 2;
else if (! Float.isNaN(negInf % negVal))
return 2;
else if (! Float.isNaN(negInf % negInf))
return 2;
else if (! Float.isNaN(negInf % posInf))
return 2;
else if (! Float.isNaN(negInf % negZero))
return 2;
else if (! Float.isNaN(negInf % posZero))
return 2;
else if (! Float.isNaN(posInf % 3.14f))
return 2;
else if (! Float.isNaN(posInf % negVal))
return 2;
else if (! Float.isNaN(posInf % negInf))
return 2;
else if (! Float.isNaN(posInf % posInf))
return 2;
else if (! Float.isNaN(posInf % negZero))
return 2;
else if (! Float.isNaN(posInf % posZero))
return 2;
else if (! Float.isNaN(negVal % negZero))
return 2;
else if (! Float.isNaN(3.14f % posZero))
return 2;
else if (! Float.isNaN(negZero % negZero))
return 2;
else if (! Float.isNaN(negZero % posZero))
return 2;
else if (! Float.isNaN(posZero % negZero))
return 2;
else if (! Float.isNaN(posZero % posZero))
return 2;
return 0;
}
}
---------------------
======================================================================