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

double (primitive) arithmetic precision error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.4.0, 1.4.2
    • 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)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: