Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4025475

float remainder with infinity/zero operand(s) is not NaN on win32.

XMLWordPrintable

    • 1.1fcs
    • x86
    • windows_nt
    • Not verified



      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;
      }
      }
      ---------------------

      ======================================================================

            sliangsunw Sheng Liang (Inactive)
            rfqsunw Rfq Rfq (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: