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

Double.toString(string) expands value

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 6
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:

      Description

      FULL PRODUCT VERSION :


      ADDITIONAL OS VERSION INFORMATION :
      Linux 2.6.21-1.3194.fc7

      A DESCRIPTION OF THE PROBLEM :
      When Double.toString(String) is called with "7.79625120912E289" as the string value, "7.796251209119999E289" is returned instead of "7.79625120912E289".



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      System.out.println(new Double("7.79625120912E289").toString());

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      "7.79625120912E289"
      ACTUAL -
      "7.796251209119999E289"

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      System.out.println(new Double("7.79625120912E289").toString());
      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bpb Brian Burkhalter
                Reporter:
                ryeung Roger Yeung (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: