compareTo method

int? compareTo(
  1. BigInt other
)

Compares this to other.

Returns a negative number if this is less than other, zero if they are equal, and a positive number if this is greater than other.

Example:

print(Obj(BigInt.from(1)).compareTo(BigInt.from(2))); // => -1
print(Obj(BigInt.from(2)).compareTo(BigInt.from(1))); // => 1
print(Obj(BigInt.from(1)).compareTo(BigInt.from(1))); // => 0

Implementation

int? compareTo(BigInt other) => value?.compareTo(other);