src/java.base/share/classes/java/math/BigInteger.java
changeset 49237 6e6c3a755b89
parent 47866 39db80b32b69
child 50062 e64e3cd120b7
equal deleted inserted replaced
49236:9552f0648b53 49237:6e6c3a755b89
     1 /*
     1 /*
     2  * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
  3554 
  3554 
  3555     /**
  3555     /**
  3556      * Returns the number of bits in the minimal two's-complement
  3556      * Returns the number of bits in the minimal two's-complement
  3557      * representation of this BigInteger, <em>excluding</em> a sign bit.
  3557      * representation of this BigInteger, <em>excluding</em> a sign bit.
  3558      * For positive BigIntegers, this is equivalent to the number of bits in
  3558      * For positive BigIntegers, this is equivalent to the number of bits in
  3559      * the ordinary binary representation.  (Computes
  3559      * the ordinary binary representation.  For zero this method returns
  3560      * {@code (ceil(log2(this < 0 ? -this : this+1)))}.)
  3560      * {@code 0}.  (Computes {@code (ceil(log2(this < 0 ? -this : this+1)))}.)
  3561      *
  3561      *
  3562      * @return number of bits in the minimal two's-complement
  3562      * @return number of bits in the minimal two's-complement
  3563      *         representation of this BigInteger, <em>excluding</em> a sign bit.
  3563      *         representation of this BigInteger, <em>excluding</em> a sign bit.
  3564      */
  3564      */
  3565     public int bitLength() {
  3565     public int bitLength() {