List of utility methods to do BigInteger Max
BigInteger | max(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; |
BigInteger | max(BigInteger first, BigInteger second) max return first.compareTo(second) < 0 ? second : first;
|
BigInteger | maxValue(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; |