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

BigInteger bitLength() method is invalid for a value of minus one (-1)

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P5 P5
    • None
    • 1.3.0
    • core-libs
    • x86
    • windows_98



      Name: boT120536 Date: 11/06/2000


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Server VM (build 2.0fcs-E, mixed mode)



      BigInteger q = new BigInteger( String.valueOf(-1) );
      q.bitLength() will give 0

      I think in a minimal two's complement notation this should still be 1 ?
      (Review ID: 106833)
      ======================================================================

            darcy Joe Darcy
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: