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