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

floating point parse incorrect on big integer

    XMLWordPrintable

Details

    • b93
    • x86_64
    • windows_7

    Description

      FULL PRODUCT VERSION :
      java version "1.8.0_40"
      Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
      Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 64bit

      A DESCRIPTION OF THE PROBLEM :
      when using the JavaScript method toPrecision() on a number type you expect it to round and truncate, but that doesn't always work with JDK8 but with JDK7.

      Input value:
      -3.33333333333333E18


      After parsing:
      -3333333333333329900

      Expected:
      -3333333333333330000
       



      REGRESSION. Last worked in version 7u76

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.7.0_55"
      Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      jjs> print (-3.33333333333333e+18);
      -3333333333333329900



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      jjs> print (-3.33333333333333e+18);
      -3333333333333330000
      ACTUAL -
      se above

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      one line as above
      ---------- END SOURCE ----------

      Attachments

        Issue Links

          Activity

            People

              hannesw Hannes Wallnoefer
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: