Trait Number

Source
pub trait Number {
    const ZERO: Self;
    const MIN: Self;
    const MAX: Self;
}
Expand description

Similar to num_traits, but we use need to be able to customize values

Required Associated Constants§

Source

const ZERO: Self

Zero value of this type

Source

const MIN: Self

Smallest finite number this type can represent

Source

const MAX: Self

Largest finite number this type can represent

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Number for f32

Source§

const ZERO: f32 = 0f32

Source§

const MIN: f32 = -3.40282347E+38f32

Source§

const MAX: f32 = 3.40282347E+38f32

Source§

impl Number for f64

Source§

const ZERO: f64 = 0f64

Source§

const MIN: f64 = -1.7976931348623157E+308f64

Source§

const MAX: f64 = 1.7976931348623157E+308f64

Source§

impl Number for i8

Source§

const ZERO: i8 = 0i8

Source§

const MIN: i8 = -128i8

Source§

const MAX: i8 = 127i8

Source§

impl Number for i16

Source§

const ZERO: i16 = 0i16

Source§

const MIN: i16 = -32_768i16

Source§

const MAX: i16 = 32_767i16

Source§

impl Number for i32

Source§

const ZERO: i32 = 0i32

Source§

const MIN: i32 = -2_147_483_648i32

Source§

const MAX: i32 = 2_147_483_647i32

Source§

impl Number for i64

Source§

const ZERO: i64 = 0i64

Source§

const MIN: i64 = -9_007_199_254_740_991i64

Source§

const MAX: i64 = 9_007_199_254_740_991i64

Source§

impl Number for u8

Source§

const ZERO: u8 = 0u8

Source§

const MIN: u8 = 0u8

Source§

const MAX: u8 = 255u8

Source§

impl Number for u16

Source§

const ZERO: u16 = 0u16

Source§

const MIN: u16 = 0u16

Source§

const MAX: u16 = 65_535u16

Source§

impl Number for u32

Source§

const ZERO: u32 = 0u32

Source§

const MIN: u32 = 0u32

Source§

const MAX: u32 = 4_294_967_295u32

Source§

impl Number for u64

Source§

const ZERO: u64 = 0u64

Source§

const MIN: u64 = 0u64

Source§

const MAX: u64 = 9_007_199_254_740_991u64

Implementors§