Linux: java.lang.Math.exp method returns incorrect value

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.3.0
    • Component/s: hotspot
    • x86
    • linux



      Name: skR10017 Date: 05/02/2000



      The following test shows incorrect behavior of java.lang.Math.exp method.
      This test fails only in Java HotSpot(TM) Client VM (build 1.3.0beta-b01, mixed mode) for linux.
      JCK1.3 api/java/lang/Math/exp_test test fails by the same reason.

      --------------------------test.java------------------------------
      public class test {

          public static void main(String [] args)
          {
              long arg=0xc0855deb851eb854L;
              long expected_result=0x247c7bf4a801836L;
              long result = Double.doubleToLongBits(Math.exp(Double.longBitsToDouble(arg)));
              if(result!=expected_result)
                  System.out.println("Failed");
              else System.out.println("Passed");
          }
      }
      ------------------------------------------------------------------

      -----------------------------output--------------------------
      Linux:

      [kotl@linux-4 2May00]$ java -version
      java version "1.3.0beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0beta-b03)
      Java HotSpot(TM) Client VM (build 1.3.0beta-b01, mixed mode)
      [kotl@linux-4 2May00]$ java test
      Failed
      [kotl@linux-4 2May00]$

      Solaris:

      bash-2.00$ java -version
      java version "1.3.0rc3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc3-Z)
      Java HotSpot(TM) Client VM (build 1.3.0rc3-Z, interpreted mode)
      bash-2.00$ java test
      Passed
      bash-2.00$
      --------------------------------------------------------------

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

            Assignee:
            Hong Zhang
            Reporter:
            Kotl Kotl (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: