isMultipleOf method
Returns true if this BigInt is a multiple of other
Example:
BigInt.from(10).isMultipleOf(BigInt.from(5)); // true
BigInt.from(11).isMultipleOf(BigInt.from(5)); // false
BigInt.zero.isMultipleOf(BigInt.from(5)); // true (0 is a multiple of any number)
Throws:
ArgumentError: Ifotheris zero
Implementation
bool isMultipleOf(BigInt other) {
if (other == BigInt.zero) {
throw ArgumentError('Cannot check if a number is a multiple of zero');
}
return this % other == BigInt.zero;
}