Android Utililty Methods BigInteger Power Calculate

List of utility methods to do BigInteger Power Calculate

Description

The list of methods to do BigInteger Power Calculate are organized into topic(s).

Method

BigIntegerpow(final BigInteger k, BigInteger e)
Raise a BigInteger to a BigInteger power.
if (e.compareTo(BigInteger.ZERO) < 0) {
    throw new NotPositiveException(LocalizedFormats.EXPONENT, e);
BigInteger result = BigInteger.ONE;
BigInteger k2p = k;
while (!BigInteger.ZERO.equals(e)) {
    if (e.testBit(0)) {
        result = result.multiply(k2p);
...
BigIntegerpow(final BigInteger k, int e)
Raise a BigInteger to an int power.
if (e < 0) {
    throw new NotPositiveException(LocalizedFormats.EXPONENT, e);
return k.pow(e);
BigIntegerpow(final BigInteger k, long e)
Raise a BigInteger to a long power.
if (e < 0) {
    throw new NotPositiveException(LocalizedFormats.EXPONENT, e);
BigInteger result = BigInteger.ONE;
BigInteger k2p = k;
while (e != 0) {
    if ((e & 0x1) != 0) {
        result = result.multiply(k2p);
...