method u128.checked_rem
Checked remainder: the remainder, or none on division by zero.
Example:
fn main() io {
print("{(7 as u128).checked_rem(4)} {(7 as u128).checked_rem(0)}")
}Output
3 none
pub(api) fn checked_rem(o: u128) -> u128?Complexity. O(1).
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
o | u128 |
Returns
u128?
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/numbers.oxl:3695