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

Math exponent results have changed since 1.7.0_u25

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 7u40
    • core-libs

      FULL PRODUCT VERSION :
      java version "1.7.0_40"
      Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
      Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Linux 64 bit (3.0.58-0.6.6-default #1 SMP Tue Feb 19 11:07:00 UTC 2013 (1576ecd) x86_64 x86_64 x86_64 GNU/Linux)
      Same behaviour noticed on Windows 7 - 64 bit

      A DESCRIPTION OF THE PROBLEM :

      Calculation of the exponenet in java.lang.Math has changed
      Using the following input: -1.0858298662222383

      gives 0.33762148893674004000 on jdk1.7.0_u25
      but 0.33762148893674000000 on jdk1.7.0_u40
      The latter value is not correct

      REGRESSION. Last worked in version 7u25

      REGRESSION : Additional Information
      java version "1.7.0_25"
      Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
      Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the test program below for both java versions to see the difference

      public class TestExp {
        public static void main(String [] args) {
          double y = -1.0858298662222383;
          double res = java.lang.Math.exp(y);
          System.out.printf("result is %.20f",res);
        }
      }

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      result should be the same
      ACTUAL -
      results are different as described above.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class TestExp {
        public static void main(String [] args) {
          double y = -1.0858298662222383;
          double res = java.lang.Math.exp(y);
          System.out.printf("result is %.20f",res);
        }
      }
      ---------- END SOURCE ----------

            darcy Joe Darcy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: