# Trait num_traits::Num [−] [src]

    pub trait Num: PartialEq + Zero + One + NumOps {
        type FromStrRadixErr;
        fn from_str_radix(
            str: &str,
            radix: u32
        ) -> Result<Self, Self::FromStrRadixErr>;
    }

The base trait for numeric types, covering `0` and `1` values, comparisons, basic numeric operations, and string conversion.

## Associated Types

### `type FromStrRadixErr`

## Required Methods

### `fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>`

Convert from a string and radix <= 36.

# Examples

    use num_traits::Num;

    let result = <i32 as Num>::from_str_radix("27", 10);
    assert_eq!(result, Ok(27));

    let result = <i32 as Num>::from_str_radix("foo", 10);
    assert!(result.is_err());Run

## Implementors

- `impl Num for usize`
- `impl Num for u8`
- `impl Num for u16`
- `impl Num for u32`
- `impl Num for u64`
- `impl Num for isize`
- `impl Num for i8`
- `impl Num for i16`
- `impl Num for i32`
- `impl Num for i64`
- `impl<T: Num> Num for Wrapping<T> where
  Wrapping<T>: Add<Output = Wrapping<T>> + Sub<Output = Wrapping<T>> + Mul<Output = Wrapping<T>> + Div<Output = Wrapping<T>> + Rem<Output = Wrapping<T>>,`
- `impl Num for f32`
- `impl Num for f64`

# 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`)