## Uses of Class
java.math.BigInteger

- Packages that use BigInteger
  Package | Description
  --- | ---
  java.math | Provides classes for performing arbitrary-precision integer arithmetic (`BigInteger`) and arbitrary-precision decimal arithmetic (`BigDecimal`).

- - ### Uses of BigInteger in java.math

    Fields in java.math declared as BigInteger
    Modifier and Type | Field and Description
    --- | ---
    `static BigInteger` | BigInteger.`ONE` The BigInteger constant one.
    `static BigInteger` | BigInteger.`TEN` The BigInteger constant ten.
    `static BigInteger` | BigInteger.`ZERO` The BigInteger constant zero.

    Methods in java.math that return BigInteger
    Modifier and Type | Method and Description
    --- | ---
    `BigInteger` | BigInteger.`abs()` Returns a BigInteger whose value is the absolute value of this BigInteger.
    `BigInteger` | BigInteger.`add(BigInteger val)` Returns a BigInteger whose value is `(this + val)`.
    `BigInteger` | BigInteger.`and(BigInteger val)` Returns a BigInteger whose value is `(this & val)`.
    `BigInteger` | BigInteger.`andNot(BigInteger val)` Returns a BigInteger whose value is `(this & ~val)`.
    `BigInteger` | BigInteger.`clearBit(int n)` Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit cleared.
    `BigInteger` | BigInteger.`divide(BigInteger val)` Returns a BigInteger whose value is `(this / val)`.
    `BigInteger[]` | BigInteger.`divideAndRemainder(BigInteger val)` Returns an array of two BigIntegers containing `(this / val)` followed by `(this % val)`.
    `BigInteger` | BigInteger.`flipBit(int n)` Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit flipped.
    `BigInteger` | BigInteger.`gcd(BigInteger val)` Returns a BigInteger whose value is the greatest common divisor of `abs(this)` and `abs(val)`.
    `BigInteger` | BigInteger.`max(BigInteger val)` Returns the maximum of this BigInteger and `val`.
    `BigInteger` | BigInteger.`min(BigInteger val)` Returns the minimum of this BigInteger and `val`.
    `BigInteger` | BigInteger.`mod(BigInteger m)` Returns a BigInteger whose value is `(this mod m`).
    `BigInteger` | BigInteger.`modInverse(BigInteger m)` Returns a BigInteger whose value is `(this`-1 `mod m)`.
    `BigInteger` | BigInteger.`modPow(BigInteger exponent, BigInteger m)` Returns a BigInteger whose value is `(thisexponent mod m)`.
    `BigInteger` | BigInteger.`multiply(BigInteger val)` Returns a BigInteger whose value is `(this * val)`.
    `BigInteger` | BigInteger.`negate()` Returns a BigInteger whose value is `(-this)`.
    `BigInteger` | BigInteger.`nextProbablePrime()` Returns the first integer greater than this `BigInteger` that is probably prime.
    `BigInteger` | BigInteger.`not()` Returns a BigInteger whose value is `(~this)`.
    `BigInteger` | BigInteger.`or(BigInteger val)` Returns a BigInteger whose value is `(this | val)`.
    `BigInteger` | BigInteger.`pow(int exponent)` Returns a BigInteger whose value is `(thisexponent)`.
    `static BigInteger` | BigInteger.`probablePrime(int bitLength, Random rnd)` Returns a positive BigInteger that is probably prime, with the specified bitLength.
    `BigInteger` | BigInteger.`remainder(BigInteger val)` Returns a BigInteger whose value is `(this % val)`.
    `BigInteger` | BigInteger.`setBit(int n)` Returns a BigInteger whose value is equivalent to this BigInteger with the designated bit set.
    `BigInteger` | BigInteger.`shiftLeft(int n)` Returns a BigInteger whose value is `(this << n)`.
    `BigInteger` | BigInteger.`shiftRight(int n)` Returns a BigInteger whose value is `(this >> n)`.
    `BigInteger` | BigInteger.`subtract(BigInteger val)` Returns a BigInteger whose value is `(this - val)`.
    `BigInteger` | BigDecimal.`toBigInteger()` Converts this `BigDecimal` to a `BigInteger`.
    `BigInteger` | BigDecimal.`toBigIntegerExact()` Converts this `BigDecimal` to a `BigInteger`, checking for lost information.
    `BigInteger` | BigDecimal.`unscaledValue()` Returns a `BigInteger` whose value is the unscaled value of this `BigDecimal`.
    `static BigInteger` | BigInteger.`valueOf(long val)` Returns a BigInteger whose value is equal to that of the specified `long`.
    `BigInteger` | BigInteger.`xor(BigInteger val)` Returns a BigInteger whose value is `(this ^ val)`.

    Methods in java.math with parameters of type BigInteger
    Modifier and Type | Method and Description
    --- | ---
    `BigInteger` | BigInteger.`add(BigInteger val)` Returns a BigInteger whose value is `(this + val)`.
    `BigInteger` | BigInteger.`and(BigInteger val)` Returns a BigInteger whose value is `(this & val)`.
    `BigInteger` | BigInteger.`andNot(BigInteger val)` Returns a BigInteger whose value is `(this & ~val)`.
    `int` | BigInteger.`compareTo(BigInteger val)` Compares this BigInteger with the specified BigInteger.
    `BigInteger` | BigInteger.`divide(BigInteger val)` Returns a BigInteger whose value is `(this / val)`.
    `BigInteger[]` | BigInteger.`divideAndRemainder(BigInteger val)` Returns an array of two BigIntegers containing `(this / val)` followed by `(this % val)`.
    `BigInteger` | BigInteger.`gcd(BigInteger val)` Returns a BigInteger whose value is the greatest common divisor of `abs(this)` and `abs(val)`.
    `BigInteger` | BigInteger.`max(BigInteger val)` Returns the maximum of this BigInteger and `val`.
    `BigInteger` | BigInteger.`min(BigInteger val)` Returns the minimum of this BigInteger and `val`.
    `BigInteger` | BigInteger.`mod(BigInteger m)` Returns a BigInteger whose value is `(this mod m`).
    `BigInteger` | BigInteger.`modInverse(BigInteger m)` Returns a BigInteger whose value is `(this`-1 `mod m)`.
    `BigInteger` | BigInteger.`modPow(BigInteger exponent, BigInteger m)` Returns a BigInteger whose value is `(thisexponent mod m)`.
    `BigInteger` | BigInteger.`multiply(BigInteger val)` Returns a BigInteger whose value is `(this * val)`.
    `BigInteger` | BigInteger.`or(BigInteger val)` Returns a BigInteger whose value is `(this | val)`.
    `BigInteger` | BigInteger.`remainder(BigInteger val)` Returns a BigInteger whose value is `(this % val)`.
    `BigInteger` | BigInteger.`subtract(BigInteger val)` Returns a BigInteger whose value is `(this - val)`.
    `BigInteger` | BigInteger.`xor(BigInteger val)` Returns a BigInteger whose value is `(this ^ val)`.

    Constructors in java.math with parameters of type BigInteger
    Constructor and Description
    `BigDecimal(BigInteger val)` Translates a `BigInteger` into a `BigDecimal`.
    `BigDecimal(BigInteger unscaledVal, int scale)` Translates a `BigInteger` unscaled value and an `int` scale into a `BigDecimal`.
    `BigDecimal(BigInteger unscaledVal, int scale, MathContext mc)` Translates a `BigInteger` unscaled value and an `int` scale into a `BigDecimal`, with rounding according to the context settings.
    `BigDecimal(BigInteger val, MathContext mc)` Translates a `BigInteger` into a `BigDecimal` rounding according to the context settings.

Copyright © 2025 API Design. All Rights Reserved.