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

java.lang.Bignum.add() method works wrong with negative numbers

XMLWordPrintable

    • 1.1
    • sparc
    • solaris_2.5
    • Not verified

      -1+2=3 (see below)

      ==== Here is the minimized test demonstrating the bug ====
      import java.lang.Bignum;
      class java_lang_Bignum_add {
        public static void main(String args[]) {
          Bignum b1=new Bignum("-1");
          Bignum b2=new Bignum("2");
          System.out.println(b1.add(b2)); // Should print "1"
        }
      }
      ==== Output of the test ====
      3

            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: