OxL Reference

method isize.checked_rem

Checked remainder: the remainder, or none on division by zero and on MIN / -1, whose quotient does not fit.

Example:

oxl✓ checked in CI
fn main() io {
  print("{(7 as isize).checked_rem(4)} {(7 as isize).checked_rem(0)}")
}
Output
3 none
pub(api) fn checked_rem(o: isize) -> isize?

Complexity. O(1).

Since. 1.0.0-beta

Parameters

NameType
oisize

Returns

isize?

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/numbers.oxl:1459

See also