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

float division zero by zero doesn't produce NaN

XMLWordPrintable

    • 1.1fcs
    • x86
    • windows_nt
    • Not verified



      Name: laC46010 Date: 01/13/97



      The following JCK1.1 test fails under JDK1.1beta3.2 on WinNT:

      EXPR/expr301/expr30101/expr30101.html

      Test produces no output. It means that all conditions in ifs are false
      Possibly 0.0 / 0.0 is not equal to NaN or
      Float.isNaN(NaNf) and Double.isNaN(NaNd) doesn't work.
      (I have not JDK1.1beta3.2 binaries yet, only run results, so please check this)

      See the source for expr30101 and run results below:

      -------------------t.java-------------------
      // Ident: @(#)expr30101.java 1.5 96/09/02
      // Copyright 09/02/96 Sun Microsystems, Inc. All Rights Reserved
      package javasoft.sqe.tests.lang.expr301.expr30101;



      import java.io.PrintStream;
      import java.lang.Float;
      import java.lang.Double;


      public class expr30101 {

              public static void main(String args[]) {
                      System.exit(run(args, System.out) + 95/*STATUS_TEMP*/);
              }
       
              public static int run(String args[],PrintStream out) {
                      float zerof = 0.0f, NaNf;
                      double zerod = 0.0d, NaNd;

                      NaNf = zerof % zerof;
                      if (Float.isNaN(NaNf)) {
                              out.print("float NaN % 3.14f produces ");
                              out.println(NaNf % 3.14f);
                      }

                      if (Float.isNaN(NaNf)) {
                              out.print("float NaN % float Inf produces ");
                              out.println(NaNf % Float.POSITIVE_INFINITY);
                      }

                      if (Float.isNaN(NaNf)) {
                              out.print("float NaN % 12.63d produces ");
                              out.println(NaNf % 12.63d);
                      }

                      if (Float.isNaN(NaNf)) {
                              out.print("double min % float NaN produces ");
                              out.println(Double.MIN_VALUE % NaNf);
                      }

                      NaNd = zerod % zerod;
                      if (Double.isNaN(NaNd)) {
                              out.print("double NaN % - 2.71d produces ");
                              out.println(NaNd % - 2.71d);
                      }

                      if (Double.isNaN(NaNd)) {
                              out.print("double NaN % 0.0 produces ");
                              out.println(NaNd % zerod);
                      }

                      if (Float.isNaN(NaNf)) {
                              out.print("- double Inf % double NaN produces ");
                              out.println(Double.NEGATIVE_INFINITY % NaNd);
                      }

                      if (Float.isNaN(NaNf) && Double.isNaN(NaNd)) {
                              out.print("floatNaN % double NaN produces ");
                              out.println(NaNf % NaNd);
                      }
                      return 1;
              }

      }
      --------------------------------------------

      #Test Results
      #Wed Jan 08 16:06:54 1997
      testsuite=file:/G:/jck11b/tests/testsuite.html
      source=expr30101.java
      bugInfo=bug #4007655 in jdk 1.0.2
      executeClass=javasoft.sqe.tests.lang.expr301.expr30101.expr30101
      title=expr30101
      status=Failed. Output file and reference file were different
      work=file:/H:/beta3_results/lang/EXPR/expr301/expr30101/
      execStatus=Completed--check results.
      description=file:/G:/jck11b/tests/lang/EXPR/expr301/expr30101/expr30101.html
      name=expr30101
      sections=compile.java executeWithVerifier
      harnessVersion=JT1.0_beta3
      file=file:/G:/jck11b/tests/lang/EXPR/expr301/expr30101/expr30101.html
      end=Wed Jan 08 16:06:54 1997
      start=Wed Jan 08 16:06:52 1997
      keywords=compile execute positive simple javaCompiler mayFail
      environment=jdk1.1

      test: file:/G:/jck11b/tests/lang/EXPR/expr301/expr30101/expr30101.html
      running script javasoft.sqe.harness.CompSimpExecTestScript -verify
      exec: F:\jdk11beta3\bin\javac -d \H:\beta3_results\classes \G:\jck11b\tests\lang\EXPR\expr301\expr30101\expr30101.java CLASSPATH=\G:\jck11b\classes;\H:\beta3_results\classes;;
      command exited, exit=0
      command result: status not set
      ----------ref:compile.java(0/0)----------
      ----------log:compile.java(0/0)----------
      exec: F:\jdk11beta3\bin\java -verify javasoft.sqe.tests.lang.expr301.expr30101.expr30101 CLASSPATH=\H:\beta3_results\classes;;\G:\jck11b\classes DISPLAY=:0.0
      command exited, exit=96
      command result: status not set
      ----------ref:executeWithVerifier(0/0)----------
      ----------log:executeWithVerifier(0/0)----------
      test result: Completed--check results.



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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: