Java Utililty Methods BigInteger Max

List of utility methods to do BigInteger Max

Description

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

Method

BigIntegermax(BigInteger a, BigInteger b)
Since Math.max() doesn't handle BigInteger
if (a == null)
    return b;
if (b == null)
    return a;
int c = a.compareTo(b);
return c < 0 ? b : a;
BigIntegermax(BigInteger first, BigInteger second)
max
return first.compareTo(second) < 0 ? second : first;
BigIntegermaxValue(final BigInteger... values)
Computes the maximum value of a given BigInteger array.
if (values == null || values.length == 0) {
    throw new IllegalArgumentException();
BigInteger maxValue = null;
for (final BigInteger value : values) {
    if (value == null) {
        throw new IllegalArgumentException();
    if (maxValue == null) {
        maxValue = value;
    } else {
        maxValue = maxValue.max(value);
return maxValue;