OxL Reference

method u32.checked_rem

Checked remainder: the remainder, or none on division by zero.

Example:

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

Complexity. O(1).

Since. 1.0.0-beta

Parameters

NameType
ou32

Returns

u32?

Effects

none declared (pure unless the body says otherwise)

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

See also