# Trait num_traits::ops::checked::CheckedDiv [−] [src]

    pub trait CheckedDiv: Sized + Div<Self, Output = Self> {
        fn checked_div(&self, v: &Self) -> Option<Self>;
    }

Performs division that returns `None` instead of panicking on division by zero and instead of wrapping around on underflow and overflow.

## Required Methods

### `fn checked_div(&self, v: &Self) -> Option<Self>`

Divides two numbers, checking for underflow, overflow and division by zero. If any of that happens, `None` is returned.

## Implementors

- `impl CheckedDiv for u8`
- `impl CheckedDiv for u16`
- `impl CheckedDiv for u32`
- `impl CheckedDiv for u64`
- `impl CheckedDiv for usize`
- `impl CheckedDiv for i8`
- `impl CheckedDiv for i16`
- `impl CheckedDiv for i32`
- `impl CheckedDiv for i64`
- `impl CheckedDiv for isize`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)