Num

Trait Num 

Source
pub trait Num
where Self: Default + Debug + Copy + PartialOrd<Self> + Add<Output = Self> + AddAssign + Sub<Output = Self> + SubAssign + Mul<Output = Self> + Div<Output = Self>,
{ const INFINITY: Self; const NEG_INFINITY: Self; // Required methods fn from(i: i16) -> Self; fn abs(self) -> Self; fn powi(self, y: u32) -> Self; // Provided method fn rat(num: i16, denom: i16) -> Self { ... } }
Expand description

A trait that describes the operations necessary for this crate’s layout algorithms.

Required Associated Constants§

Source

const INFINITY: Self

Source

const NEG_INFINITY: Self

Required Methods§

Source

fn from(i: i16) -> Self

Source

fn abs(self) -> Self

Source

fn powi(self, y: u32) -> Self

Provided Methods§

Source

fn rat(num: i16, denom: i16) -> Self

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

Available on crate feature std only.
Source§

const INFINITY: Self = +Inf_f32

Source§

const NEG_INFINITY: Self = -Inf_f32

Source§

fn from(i: i16) -> f32

Source§

fn abs(self) -> f32

Source§

fn powi(self, y: u32) -> f32

Implementors§

Source§

impl<F: FixedSigned> Num for Fixed<F>

Source§

const INFINITY: Self = Self::MAX

Source§

const NEG_INFINITY: Self = Self::MIN