Lines Matching defs:exponent

1385      * Returns a BigInteger whose value is <tt>(this<sup>exponent</sup>)</tt>.
1386 * Note that {@code exponent} is an integer rather than a BigInteger.
1388 * @param exponent exponent to which this BigInteger is to be raised.
1389 * @return <tt>this<sup>exponent</sup></tt>
1390 * @throws ArithmeticException {@code exponent} is negative. (This would
1393 public BigInteger pow(int exponent) {
1394 if (exponent < 0)
1395 throw new ArithmeticException("Negative exponent");
1397 return (exponent==0 ? ONE : this);
1400 int newSign = (signum<0 && (exponent&1)==1 ? -1 : 1);
1404 while (exponent != 0) {
1405 if ((exponent & 1)==1) {
1410 if ((exponent >>>= 1) != 0) {
1563 * <tt>(this<sup>exponent</sup> mod m)</tt>. (Unlike {@code pow}, this
1566 * @param exponent the exponent.
1568 * @return <tt>this<sup>exponent</sup> mod m</tt>
1569 * @throws ArithmeticException {@code m} &le; 0 or the exponent is
1574 public BigInteger modPow(BigInteger exponent, BigInteger m) {
1579 if (exponent.signum == 0)
1585 if (this.equals(ZERO) && exponent.signum >= 0)
1588 if (this.equals(negConst[1]) && (!exponent.testBit(0)))
1592 if ((invertResult = (exponent.signum < 0)))
1593 exponent = exponent.negate();
1599 result = base.oddModPow(exponent, m);
1617 // Caculate (base ** exponent) mod m1.
1619 base2.oddModPow(exponent, m1));
1621 // Calculate (this ** exponent) mod m2
1622 BigInteger a2 = base.modPow2(exponent, p);
1648 * and then keep appending exponent bits to it. The following patterns
1662 * multiply k bits of exponent at a time. Actually, assuming random
1666 * you have to do one multiply per k+1 bits of exponent.
1668 * The loop walks down the exponent, squaring the result buffer as
1670 * filled with the upcoming exponent bits. (What is read after the
1671 * end of the exponent is unimportant, but it is filled with zero here.)
1689 * where z is the high k bits of the exponent, 1/2 of the time
1700 // Special case for exponent of one
1716 // if exponent is 65537 (0x10001), use minimum window size
1768 // Pre load the window that slides over the exponent
1967 * Returns a BigInteger whose value is (this ** exponent) mod (2**p)
1969 private BigInteger modPow2(BigInteger exponent, int p) {
1978 int limit = exponent.bitLength();
1984 if (exponent.testBit(expOffset))