Num

Trait Num 

Source
pub trait Num: UNum + Neg<Output = Self> {
    // Required method
    fn signum(self) -> Self;

    // Provided method
    fn abs(self) -> Self { ... }
}
Expand description

Generic signed number type

Required Methods§

Source

fn signum(self) -> Self

Returns a number representing sign of self.

Provided Methods§

Source

fn abs(self) -> Self

Calculate absolute value

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 Num for f32

Source§

fn signum(self) -> Self

Source§

impl Num for f64

Source§

fn signum(self) -> Self

Source§

impl Num for i8

Source§

fn signum(self) -> Self

Source§

impl Num for i16

Source§

fn signum(self) -> Self

Source§

impl Num for i32

Source§

fn signum(self) -> Self

Source§

impl Num for i64

Source§

fn signum(self) -> Self

Source§

impl Num for isize

Source§

fn signum(self) -> Self

Implementors§

Source§

impl<T: Float> Num for RealImpl<T>