[−][src]Struct ordered_float::OrderedFloat
A wrapper around Floats providing an implementation of Ord and Hash.
NaN is sorted as greater than all other values and equal to itself, in contradiction with the IEEE standard.
Implementations
impl<T: Float> OrderedFloat<T>
[src]
pub fn into_inner(self) -> T
[src]
Get the value out.
Trait Implementations
impl<T: Add> Add<OrderedFloat<T>> for OrderedFloat<T>
[src]
type Output = OrderedFloat<T::Output>
The resulting type after applying the +
operator.
fn add(self, other: Self) -> Self::Output
[src]
impl<T: Add> Add<T> for OrderedFloat<T>
[src]
type Output = OrderedFloat<T::Output>
The resulting type after applying the +
operator.
fn add(self, other: T) -> Self::Output
[src]
impl<T: Float> AsMut<T> for OrderedFloat<T>
[src]
impl<T: Float> AsRef<T> for OrderedFloat<T>
[src]
impl<T: Bounded> Bounded for OrderedFloat<T>
[src]
impl<T: Clone> Clone for OrderedFloat<T>
[src]
fn clone(&self) -> OrderedFloat<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy> Copy for OrderedFloat<T>
[src]
impl<T: Debug> Debug for OrderedFloat<T>
[src]
impl<T: Default> Default for OrderedFloat<T>
[src]
fn default() -> OrderedFloat<T>
[src]
impl<T: Float> Deref for OrderedFloat<T>
[src]
impl<T: Float> DerefMut for OrderedFloat<T>
[src]
impl<T: Float + Display> Display for OrderedFloat<T>
[src]
impl<T: Div> Div<OrderedFloat<T>> for OrderedFloat<T>
[src]
type Output = OrderedFloat<T::Output>
The resulting type after applying the /
operator.
fn div(self, other: Self) -> Self::Output
[src]
impl<T: Div> Div<T> for OrderedFloat<T>
[src]
type Output = OrderedFloat<T::Output>
The resulting type after applying the /
operator.
fn div(self, other: T) -> Self::Output
[src]
impl<T: Float> Eq for OrderedFloat<T>
[src]
impl<T: Float> Float for OrderedFloat<T>
[src]
fn nan() -> Self
[src]
fn infinity() -> Self
[src]
fn neg_infinity() -> Self
[src]
fn neg_zero() -> Self
[src]
fn min_value() -> Self
[src]
fn min_positive_value() -> Self
[src]
fn max_value() -> Self
[src]
fn is_nan(self) -> bool
[src]
fn is_infinite(self) -> bool
[src]
fn is_finite(self) -> bool
[src]
fn is_normal(self) -> bool
[src]
fn classify(self) -> FpCategory
[src]
fn floor(self) -> Self
[src]
fn ceil(self) -> Self
[src]
fn round(self) -> Self
[src]
fn trunc(self) -> Self
[src]
fn fract(self) -> Self
[src]
fn abs(self) -> Self
[src]
fn signum(self) -> Self
[src]
fn is_sign_positive(self) -> bool
[src]
fn is_sign_negative(self) -> bool
[src]
fn mul_add(self, a: Self, b: Self) -> Self
[src]
fn recip(self) -> Self
[src]
fn powi(self, n: i32) -> Self
[src]
fn powf(self, n: Self) -> Self
[src]
fn sqrt(self) -> Self
[src]
fn exp(self) -> Self
[src]
fn exp2(self) -> Self
[src]
fn ln(self) -> Self
[src]
fn log(self, base: Self) -> Self
[src]
fn log2(self) -> Self
[src]
fn log10(self) -> Self
[src]
fn max(self, other: Self) -> Self
[src]
fn min(self, other: Self) -> Self
[src]
fn abs_sub(self, other: Self) -> Self
[src]
fn cbrt(self) -> Self
[src]
fn hypot(self, other: Self) -> Self
[src]
fn sin(self) -> Self
[src]
fn cos(self) -> Self
[src]
fn tan(self) -> Self
[src]
fn asin(self) -> Self
[src]
fn acos(self) -> Self
[src]
fn atan(self) -> Self
[src]
fn atan2(self, other: Self) -> Self
[src]
fn sin_cos(self) -> (Self, Self)
[src]
fn exp_m1(self) -> Self
[src]
fn ln_1p(self) -> Self
[src]
fn sinh(self) -> Self
[src]
fn cosh(self) -> Self
[src]
fn tanh(self) -> Self
[src]
fn asinh(self) -> Self
[src]
fn acosh(self) -> Self
[src]
fn atanh(self) -> Self
[src]
fn integer_decode(self) -> (u64, i16, i8)
[src]
fn epsilon() -> Self
[src]
fn to_degrees(self) -> Self
[src]
fn to_radians(self) -> Self
[src]
impl<T: Float> FloatCore for OrderedFloat<T>
[src]
fn nan() -> Self
[src]
fn infinity() -> Self
[src]
fn neg_infinity() -> Self
[src]
fn neg_zero() -> Self
[src]
fn min_value() -> Self
[src]
fn min_positive_value() -> Self
[src]
fn max_value() -> Self
[src]
fn is_nan(self) -> bool
[src]
fn is_infinite(self) -> bool
[src]
fn is_finite(self) -> bool
[src]
fn is_normal(self) -> bool
[src]
fn classify(self) -> FpCategory
[src]
fn floor(self) -> Self
[src]
fn ceil(self) -> Self
[src]
fn round(self) -> Self
[src]
fn trunc(self) -> Self
[src]
fn fract(self) -> Self
[src]
fn abs(self) -> Self
[src]
fn signum(self) -> Self
[src]
fn is_sign_positive(self) -> bool
[src]
fn is_sign_negative(self) -> bool
[src]
fn recip(self) -> Self
[src]
fn powi(self, n: i32) -> Self
[src]
fn integer_decode(self) -> (u64, i16, i8)
[src]
fn epsilon() -> Self
[src]
fn to_degrees(self) -> Self
[src]
fn to_radians(self) -> Self
[src]
pub fn min(self, other: Self) -> Self
[src]
pub fn max(self, other: Self) -> Self
[src]
impl<'a, T: Float> From<&'a T> for &'a OrderedFloat<T>
[src]
fn from(t: &'a T) -> &'a OrderedFloat<T>
[src]
impl<'a, T: Float> From<&'a mut T> for &'a mut OrderedFloat<T>
[src]
fn from(t: &'a mut T) -> &'a mut OrderedFloat<T>
[src]
impl<T: Float> From<T> for OrderedFloat<T>
[src]
impl<T: FromPrimitive> FromPrimitive for OrderedFloat<T>
[src]
fn from_i64(n: i64) -> Option<Self>
[src]
fn from_u64(n: u64) -> Option<Self>
[src]
fn from_isize(n: isize) -> Option<Self>
[src]
fn from_i8(n: i8) -> Option<Self>
[src]
fn from_i16(n: i16) -> Option<Self>
[src]
fn from_i32(n: i32) -> Option<Self>
[src]
fn from_usize(n: usize) -> Option<Self>
[src]
fn from_u8(n: u8) -> Option<Self>
[src]
fn from_u16(n: u16) -> Option<Self>
[src]
fn from_u32(n: u32) -> Option<Self>
[src]
fn from_f32(n: f32) -> Option<Self>
[src]
fn from_f64(n: f64) -> Option<Self>
[src]
pub fn from_i128(n: i128) -> Option<Self>
[src]
pub fn from_u128(n: u128) -> Option<Self>
[src]
impl<T: FromStr> FromStr for OrderedFloat<T>
[src]
type Err = T::Err
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
Convert a &str to OrderedFloat
. Returns an error if the string fails to parse.
use ordered_float::OrderedFloat; assert!("-10".parse::<OrderedFloat<f32>>().is_ok()); assert!("abc".parse::<OrderedFloat<f32>>().is_err()); assert!("NaN".parse::<OrderedFloat<f32>>().is_ok());
impl<T: Float> Hash for OrderedFloat<T>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<f32> for OrderedFloat<f32>
[src]
impl Into<f64> for OrderedFloat<f64>
[src]
impl<T: Mul> Mul<OrderedFloat<T>> for OrderedFloat<T>
[src]
type Output = OrderedFloat<T::Output>
The resulting type after applying the *
operator.
fn mul(self, other: Self) -> Self::Output
[src]
impl<T: Mul> Mul<T> for OrderedFloat<T>
[src]
type Output = OrderedFloat<T::Output>
The resulting type after applying the *
operator.
fn mul(self, other: T) -> Self::Output
[src]
impl<T: Neg> Neg for OrderedFloat<T>
[src]
type Output = OrderedFloat<T::Output>
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl<T: Float + Num> Num for OrderedFloat<T>
[src]
type FromStrRadixErr = T::FromStrRadixErr
fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
[src]
impl<T: NumCast> NumCast for OrderedFloat<T>
[src]
fn from<F: ToPrimitive>(n: F) -> Option<Self>
[src]
impl<T: One> One for OrderedFloat<T>
[src]
fn one() -> Self
[src]
pub fn set_one(&mut self)
[src]
pub fn is_one(&self) -> bool where
Self: PartialEq<Self>,
[src]
Self: PartialEq<Self>,
impl<T: Float> Ord for OrderedFloat<T>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T: Float> PartialEq<OrderedFloat<T>> for OrderedFloat<T>
[src]
fn eq(&self, other: &OrderedFloat<T>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: Float> PartialEq<T> for OrderedFloat<T>
[src]
impl<T: Float> PartialOrd<OrderedFloat<T>> for OrderedFloat<T>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: Rem> Rem<OrderedFloat<T>> for OrderedFloat<T>
[src]
type Output = OrderedFloat<T::Output>
The resulting type after applying the %
operator.
fn rem(self, other: Self) -> Self::Output
[src]
impl<T: Rem> Rem<T> for OrderedFloat<T>
[src]
type Output = OrderedFloat<T::Output>
The resulting type after applying the %
operator.
fn rem(self, other: T) -> Self::Output
[src]
impl<T: Sub> Sub<OrderedFloat<T>> for OrderedFloat<T>
[src]
type Output = OrderedFloat<T::Output>
The resulting type after applying the -
operator.
fn sub(self, other: Self) -> Self::Output
[src]
impl<T: Sub> Sub<T> for OrderedFloat<T>
[src]
type Output = OrderedFloat<T::Output>
The resulting type after applying the -
operator.
fn sub(self, other: T) -> Self::Output
[src]
impl<T: ToPrimitive> ToPrimitive for OrderedFloat<T>
[src]
fn to_i64(&self) -> Option<i64>
[src]
fn to_u64(&self) -> Option<u64>
[src]
fn to_isize(&self) -> Option<isize>
[src]
fn to_i8(&self) -> Option<i8>
[src]
fn to_i16(&self) -> Option<i16>
[src]
fn to_i32(&self) -> Option<i32>
[src]
fn to_usize(&self) -> Option<usize>
[src]
fn to_u8(&self) -> Option<u8>
[src]
fn to_u16(&self) -> Option<u16>
[src]
fn to_u32(&self) -> Option<u32>
[src]
fn to_f32(&self) -> Option<f32>
[src]
fn to_f64(&self) -> Option<f64>
[src]
pub fn to_i128(&self) -> Option<i128>
[src]
pub fn to_u128(&self) -> Option<u128>
[src]
impl<T: Zero> Zero for OrderedFloat<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for OrderedFloat<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for OrderedFloat<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for OrderedFloat<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for OrderedFloat<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for OrderedFloat<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
[src]
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
impl<T> Real for T where
T: Float,
[src]
T: Float,
pub fn min_value() -> T
[src]
pub fn min_positive_value() -> T
[src]
pub fn epsilon() -> T
[src]
pub fn max_value() -> T
[src]
pub fn floor(self) -> T
[src]
pub fn ceil(self) -> T
[src]
pub fn round(self) -> T
[src]
pub fn trunc(self) -> T
[src]
pub fn fract(self) -> T
[src]
pub fn abs(self) -> T
[src]
pub fn signum(self) -> T
[src]
pub fn is_sign_positive(self) -> bool
[src]
pub fn is_sign_negative(self) -> bool
[src]
pub fn mul_add(self, a: T, b: T) -> T
[src]
pub fn recip(self) -> T
[src]
pub fn powi(self, n: i32) -> T
[src]
pub fn powf(self, n: T) -> T
[src]
pub fn sqrt(self) -> T
[src]
pub fn exp(self) -> T
[src]
pub fn exp2(self) -> T
[src]
pub fn ln(self) -> T
[src]
pub fn log(self, base: T) -> T
[src]
pub fn log2(self) -> T
[src]
pub fn log10(self) -> T
[src]
pub fn to_degrees(self) -> T
[src]
pub fn to_radians(self) -> T
[src]
pub fn max(self, other: T) -> T
[src]
pub fn min(self, other: T) -> T
[src]
pub fn abs_sub(self, other: T) -> T
[src]
pub fn cbrt(self) -> T
[src]
pub fn hypot(self, other: T) -> T
[src]
pub fn sin(self) -> T
[src]
pub fn cos(self) -> T
[src]
pub fn tan(self) -> T
[src]
pub fn asin(self) -> T
[src]
pub fn acos(self) -> T
[src]
pub fn atan(self) -> T
[src]
pub fn atan2(self, other: T) -> T
[src]
pub fn sin_cos(self) -> (T, T)
[src]
pub fn exp_m1(self) -> T
[src]
pub fn ln_1p(self) -> T
[src]
pub fn sinh(self) -> T
[src]
pub fn cosh(self) -> T
[src]
pub fn tanh(self) -> T
[src]
pub fn asinh(self) -> T
[src]
pub fn acosh(self) -> T
[src]
pub fn atanh(self) -> T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,