Trait number_prefix::Amounts

source ·
pub trait Amounts: Copy + Sized + PartialOrd + Div<Output = Self> + Neg<Output = Self> {
    const NUM_1000: Self;
    const NUM_1024: Self;

    // Required method
    fn is_negative(self) -> bool;
}
Expand description

Traits for floating-point values for both the possible multipliers. They need to be Copy, have defined 1000 and 1024s, and implement a bunch of operators.

Required Associated Constants§

source

const NUM_1000: Self

The constant representing 1000, for decimal prefixes.

source

const NUM_1024: Self

The constant representing 1024, for binary prefixes.

Required Methods§

source

fn is_negative(self) -> bool

Whether this number is negative. This is used internally.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Amounts for f32

source§

const NUM_1000: Self = 1000f32

source§

const NUM_1024: Self = 1024f32

source§

fn is_negative(self) -> bool

source§

impl Amounts for f64

source§

const NUM_1000: Self = 1000f64

source§

const NUM_1024: Self = 1024f64

source§

fn is_negative(self) -> bool

Implementors§