取余 抽象方法
- BigInt other
返回 this 对 other 进行截断除法后的余数。
此操作的 r 结果满足:this == (this ~/ other) * other + r。因此,余数 r 与除数 this 具有相同的符号。
示例
print(BigInt.from(5).remainder(BigInt.from(3))); // 2
print(BigInt.from(-5).remainder(BigInt.from(3))); // -2
print(BigInt.from(5).remainder(BigInt.from(-3))); // 2
print(BigInt.from(-5).remainder(BigInt.from(-3))); // -2
实现
BigInt remainder(BigInt other);