Trait SignedNumberOps

Source
pub trait SignedNumberOps<T: SignedNumber>: Neg<Output = Self> {
    // Required methods
    fn signum(a: Self) -> Self;
    fn abs(a: Self) -> Self;
}
Expand description

operations applicable to signed types

Required Methods§

Source

fn signum(a: Self) -> Self

returns sign value of a; -1 = negative, 1 = positive or 0 (integers only)

Source

fn abs(a: Self) -> Self

returns the absolute (postive) value of a

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

Source§

fn signum(v: Self) -> Self

Source§

fn abs(v: Self) -> Self

Source§

impl SignedNumberOps<f64> for f64

Source§

fn signum(v: Self) -> Self

Source§

fn abs(v: Self) -> Self

Source§

impl SignedNumberOps<i8> for i8

Source§

fn signum(v: Self) -> Self

Source§

fn abs(v: Self) -> Self

Source§

impl SignedNumberOps<i16> for i16

Source§

fn signum(v: Self) -> Self

Source§

fn abs(v: Self) -> Self

Source§

impl SignedNumberOps<i32> for i32

Source§

fn signum(v: Self) -> Self

Source§

fn abs(v: Self) -> Self

Source§

impl SignedNumberOps<i64> for i64

Source§

fn signum(v: Self) -> Self

Source§

fn abs(v: Self) -> Self

Implementors§