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

Double.toString(string) expands value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • tbd
    • 6
    • core-libs

      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 ----------

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: