double (primitive) arithmetic precision error

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • None
    • Affects Version/s: 1.4.0, 1.4.2
    • Component/s: core-libs
    • generic, x86
    • generic, windows_2000



      Name: nt126004 Date: 08/28/2001


      java version "1.3.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
      Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

      public class d{
      public static void main(String [] args) {
      double i = 0.3 + 0.03;
      System.out.println(i);
      }
      }

      the result should be i == 0.33
      but the result given is 0.329999999998
      (Review ID: 130785)
      ======================================================================

            Assignee:
            Joe Darcy
            Reporter:
            Nathanael Thompson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: