Trait honestintervals::fp::Float
[−]
[src]
pub trait Float: From<f64> + FromStr + Clone + Display + Into<f64> + PartialOrd + From<f64> + FromStr + Neg<Output = Self> + Abs + Add + Sub + Mul + Div + MinMax + Transc { fn zero(precision: usize) -> Self; fn neg_zero(precision: usize) -> Self; fn one(precision: usize) -> Self; fn infinity(precision: usize) -> Self; fn neg_infinity(precision: usize) -> Self; fn nan(precision: usize) -> Self; fn sign(&self) -> Sign; fn precision(&self) -> usize; fn is_finite(&self) -> bool; fn is_infinite(&self) -> bool; fn is_zero(&self) -> bool; fn is_infinity(&self) -> bool; fn is_neg_infinity(&self) -> bool; fn is_nan(&self) -> bool; }
All-encapsulating trait for finite precision floats.
Required Methods
fn zero(precision: usize) -> Self
Constructs a float representing zero.
fn neg_zero(precision: usize) -> Self
Constructs a float representing negative zero.
fn one(precision: usize) -> Self
Constructs a float representing one.
fn infinity(precision: usize) -> Self
Constructs a float representing positive infinity.
fn neg_infinity(precision: usize) -> Self
Constructs a float representing negative infinity.
fn nan(precision: usize) -> Self
Constructs a float representing NaN.
fn sign(&self) -> Sign
Returns the sign of self
.
fn precision(&self) -> usize
Returns the precision of self
.
fn is_finite(&self) -> bool
Whether self
is a regular number (non-infinity and non-NaN).
fn is_infinite(&self) -> bool
Whether self
is either positive infinity or negative infinity.
fn is_zero(&self) -> bool
Whether self
is zero (or negative zero).
fn is_infinity(&self) -> bool
Whether self
is positive infinity.
fn is_neg_infinity(&self) -> bool
Whether self
is negative infinity.
fn is_nan(&self) -> bool
Whether self
is NaN.