Trait SignedExt

Source
pub trait SignedExt: Signed {
    // Provided methods
    fn sign(self) -> Sign { ... }
    fn signum_or_zero(self) -> Self
       where Self: Zero { ... }
}
Expand description

Function returning number representing sign of self

Provided Methods§

Source

fn sign(self) -> Sign

Source

fn signum_or_zero(self) -> Self
where Self: Zero,

Maps 0.0 to 0.0, otherwise equal to S::signum (which would otherwise map +0.0 -> 1.0 and -0.0 -> -1.0)

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

Source§

impl SignedExt for f64

Source§

impl SignedExt for i8

Source§

impl SignedExt for i16

Source§

impl SignedExt for i32

Source§

impl SignedExt for i64

Source§

impl<U> SignedExt for FixedI8<U>
where U: Unsigned + LtU8 + IsLessOrEqual<U6, Output = True>,

Source§

impl<U> SignedExt for FixedI16<U>
where U: Unsigned + LtU16 + IsLessOrEqual<U14, Output = True>,

Source§

impl<U> SignedExt for FixedI32<U>
where U: Unsigned + LtU32 + IsLessOrEqual<U30, Output = True>,

Source§

impl<U> SignedExt for FixedI64<U>
where U: Unsigned + LtU64 + IsLessOrEqual<U62, Output = True>,

Implementors§