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

java.lang.Bignum constructor(double,int) works wrong

XMLWordPrintable

    • sparc
    • solaris_2.5

      This constructor can create objects with incorrect values
      ==== Here is the minimized test demonstrating the bug ====
      import java.lang.Bignum;
      class java_lang_Bignum_constructor {
        public static void main(String args[]) {
          Bignum b=new Bignum(0.0001F,20);
          System.out.println(b); // should print 0.00010000000000000000
          System.out.println(b.floatValue()); // should print 0.0001
        }
      }
      ===== Here is the output of the test ====
      999999.97473787520000000000
      1000000.0

            mhapnersunw Mark Hapner (Inactive)
            mgorshen Mikhail Gorshenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: