BigInteger.compareTo

Compares this BigInteger with the specified BigInteger. This method is provided in preference to individual methods for each of the six bool comparison operators ({@literal <}, ==, {@literal >}, {@literal >=}, !=, {@literal <=}). The suggested idiom for performing these comparisons is: {@code (x.compareTo(y)} &lt;<i>op</i>&gt; {@code 0)}, where &lt;<i>op</i>&gt; is one of the six comparison operators.

@param val BigInteger to which this BigInteger is to be compared. @return -1, 0 or 1 as this BigInteger is numerically less than, equal to, or greater than {@code val}.

class BigInteger
int
compareTo

Meta