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

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

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1
    • CPU:
      sparc
    • OS:
      solaris_2.5
    • Verification:
      Not verified

      Description

      -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

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: