OxL Reference

method u64.checked_div

Checked division (truncating toward zero): the quotient, or none on division by zero.

Example:

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

Complexity. O(1).

Since. 1.0.0-beta

Parameters

NameType
ou64

Returns

u64?

Effects

none declared (pure unless the body says otherwise)

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

See also