dart:core 库中BigInt.operator_modulo 方法的用法介绍如下。
用法:
BigInt operator %(
BigInt other
)
欧几里得模运算符。
返回欧几里得除法的余数。两个整数 a 和 b 的欧几里得除法产生两个整数 q 和 r 使得 a == b * q + r 和 0 <= r < b.abs() 。
返回值r 的符号始终为正。
有关截断除法的其余部分,请参见remainder。
例子:
print(BigInt.from(5) % BigInt.from(3)); // 2
print(BigInt.from(-5) % BigInt.from(3)); // 1
print(BigInt.from(5) % BigInt.from(-3)); // 2
print(BigInt.from(-5) % BigInt.from(-3)); // 1
相关用法
- Dart BigInt.operator_divide用法及代码示例
- Dart BigInt.operator_truncate_divide用法及代码示例
- Dart BigInt.toRadixString用法及代码示例
- Dart BigInt.from用法及代码示例
- Dart BigInt.isValidInt用法及代码示例
- Dart BigInt.toDouble用法及代码示例
- Dart BigInt.parse用法及代码示例
- Dart BigInt.bitLength用法及代码示例
- Dart BigInt.gcd用法及代码示例
- Dart BigInt.tryParse用法及代码示例
- Dart BigInt.compareTo用法及代码示例
- Dart BigInt.remainder用法及代码示例
- Dart BigInt.toInt用法及代码示例
- Dart BigInt.toUnsigned用法及代码示例
- Dart BigInt.toString用法及代码示例
- Dart BigInt.pow用法及代码示例
- Dart BigInt.toSigned用法及代码示例
- Dart BigInt用法及代码示例
- Dart Base64Encoder用法及代码示例
- Dart ByteData.view用法及代码示例
- Dart ByteData用法及代码示例
- Dart Base64Decoder用法及代码示例
- Dart MapMixin.containsKey用法及代码示例
- Dart Iterator用法及代码示例
- Dart AttributeClassSet.intersection用法及代码示例
注:本文由纯净天空筛选整理自dart.dev大神的英文原创作品 operator % method。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
