NotNan

Struct NotNan 

Source
pub struct NotNan<T>(/* private fields */);
Expand description

A wrapper around floats providing an implementation of Eq, Ord and Hash.

A NaN value cannot be stored in this type.

use ordered_float::NotNan;

let mut v = [
    NotNan::new(2.0).unwrap(),
    NotNan::new(1.0).unwrap(),
];
v.sort();
assert_eq!(v, [1.0, 2.0]);

Because NotNan implements Ord and Eq, it can be used as a key in a HashSet, HashMap, BTreeMap, or BTreeSet (unlike the primitive f32 or f64 types):

let mut s: HashSet<NotNan<f32>> = HashSet::new();
let key = NotNan::new(1.0).unwrap();
s.insert(key);
assert!(s.contains(&key));

-0.0 and +0.0 are still considered equal. This different sign may show up in printing, or when dividing by zero (the sign of the zero becomes the sign of the resulting infinity). Therefore, NotNan may be unsuitable for use as a key in interning and memoization applications which require equal results from equal inputs, unless signed zeros make no difference or are canonicalized before insertion.

Arithmetic on NotNan values will panic if it produces a NaN value:

let a = NotNan::new(std::f32::INFINITY).unwrap();
let b = NotNan::new(std::f32::NEG_INFINITY).unwrap();

// This will panic:
let c = a + b;

§Representation

NotNan has #[repr(transparent)], so it is sound to use transmute or pointer casts to convert between any type T and NotNan<T>, as long as this does not create a NaN value. However, consider using bytemuck as a safe alternative if possible.

Implementations§

Source§

impl<T> NotNan<T>
where T: FloatCore,

Source

pub fn new(val: T) -> Result<NotNan<T>, FloatIsNan>

Create a NotNan value.

Returns Err if val is NaN

Source§

impl<T> NotNan<T>

Source

pub fn into_inner(self) -> T

Get the value out.

Source

pub const unsafe fn new_unchecked(val: T) -> NotNan<T>

Create a NotNan value from a value that is guaranteed to not be NaN

§Safety

Behaviour is undefined if val is NaN

Source

pub const unsafe fn unchecked_new(val: T) -> NotNan<T>

👎Deprecated since 2.5.0: Please use the new_unchecked function instead.

Create a NotNan value from a value that is guaranteed to not be NaN

§Safety

Behaviour is undefined if val is NaN

Source§

impl NotNan<f64>

Source

pub fn as_f32(self) -> NotNan<f32>

Converts this NotNan<f64> to a NotNan<f32> while giving up on precision, using roundTiesToEven as rounding mode, yielding Infinity on overflow.

Note: For the reverse conversion (from NotNan<f32> to NotNan<f64>), you can use .into().

Trait Implementations§

Source§

impl<T> Add<&NotNan<T>> for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: &NotNan<T>) -> <NotNan<T> as Add<&NotNan<T>>>::Output

Performs the + operation. Read more
Source§

impl<T> Add<&T> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: &T) -> <&NotNan<T> as Add<&T>>::Output

Performs the + operation. Read more
Source§

impl<T> Add<&T> for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: &T) -> <NotNan<T> as Add<&T>>::Output

Performs the + operation. Read more
Source§

impl<T> Add<NotNan<T>> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: NotNan<T>) -> <&NotNan<T> as Add<NotNan<T>>>::Output

Performs the + operation. Read more
Source§

impl<T> Add<T> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: T) -> <&NotNan<T> as Add<T>>::Output

Performs the + operation. Read more
Source§

impl<T> Add<T> for NotNan<T>
where T: FloatCore,

Adds a float directly.

Panics if the provided value is NaN or the computation results in NaN

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: T) -> NotNan<T>

Performs the + operation. Read more
Source§

impl<T> Add for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: &NotNan<T>) -> <&NotNan<T> as Add>::Output

Performs the + operation. Read more
Source§

impl<T> Add for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: NotNan<T>) -> NotNan<T>

Performs the + operation. Read more
Source§

impl<T> AddAssign<&NotNan<T>> for NotNan<T>
where T: FloatCore + AddAssign,

Source§

fn add_assign(&mut self, other: &NotNan<T>)

Performs the += operation. Read more
Source§

impl<T> AddAssign<&T> for NotNan<T>
where T: FloatCore + AddAssign,

Source§

fn add_assign(&mut self, other: &T)

Performs the += operation. Read more
Source§

impl<T> AddAssign<T> for NotNan<T>
where T: FloatCore + AddAssign,

Source§

fn add_assign(&mut self, other: T)

Performs the += operation. Read more
Source§

impl<T> AddAssign for NotNan<T>
where T: FloatCore + AddAssign,

Source§

fn add_assign(&mut self, other: NotNan<T>)

Performs the += operation. Read more
Source§

impl AsPrimitive<NotNan<f32>> for NotNan<f32>

Source§

fn as_(self) -> NotNan<f32>

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<NotNan<f32>> for NotNan<f64>

Source§

fn as_(self) -> NotNan<f32>

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<NotNan<f32>> for u32

Source§

fn as_(self) -> NotNan<f32>

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<NotNan<f64>> for NotNan<f32>

Source§

fn as_(self) -> NotNan<f64>

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<NotNan<f64>> for NotNan<f64>

Source§

fn as_(self) -> NotNan<f64>

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<NotNan<f64>> for u32

Source§

fn as_(self) -> NotNan<f64>

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<f32> for NotNan<f32>

Source§

fn as_(self) -> f32

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<f32> for NotNan<f64>

Source§

fn as_(self) -> f32

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<f64> for NotNan<f32>

Source§

fn as_(self) -> f64

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<f64> for NotNan<f64>

Source§

fn as_(self) -> f64

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<i16> for NotNan<f32>

Source§

fn as_(self) -> i16

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<i16> for NotNan<f64>

Source§

fn as_(self) -> i16

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<i32> for NotNan<f32>

Source§

fn as_(self) -> i32

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<i32> for NotNan<f64>

Source§

fn as_(self) -> i32

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<i64> for NotNan<f32>

Source§

fn as_(self) -> i64

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<i64> for NotNan<f64>

Source§

fn as_(self) -> i64

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<i8> for NotNan<f32>

Source§

fn as_(self) -> i8

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<i8> for NotNan<f64>

Source§

fn as_(self) -> i8

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<isize> for NotNan<f32>

Source§

fn as_(self) -> isize

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<isize> for NotNan<f64>

Source§

fn as_(self) -> isize

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<u16> for NotNan<f32>

Source§

fn as_(self) -> u16

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<u16> for NotNan<f64>

Source§

fn as_(self) -> u16

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<u32> for NotNan<f32>

Source§

fn as_(self) -> u32

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<u32> for NotNan<f64>

Source§

fn as_(self) -> u32

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<u64> for NotNan<f32>

Source§

fn as_(self) -> u64

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<u64> for NotNan<f64>

Source§

fn as_(self) -> u64

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<u8> for NotNan<f32>

Source§

fn as_(self) -> u8

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<u8> for NotNan<f64>

Source§

fn as_(self) -> u8

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<usize> for NotNan<f32>

Source§

fn as_(self) -> usize

Convert a value to another, using the as operator.
Source§

impl AsPrimitive<usize> for NotNan<f64>

Source§

fn as_(self) -> usize

Convert a value to another, using the as operator.
Source§

impl<T> AsRef<T> for NotNan<T>
where T: FloatCore,

Source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<f32> for NotNan<f32>

Source§

fn borrow(&self) -> &f32

Immutably borrows from an owned value. Read more
Source§

impl Borrow<f64> for NotNan<f64>

Source§

fn borrow(&self) -> &f64

Immutably borrows from an owned value. Read more
Source§

impl<T> Bounded for NotNan<T>
where T: FloatCore,

Source§

fn min_value() -> NotNan<T>

Returns the smallest finite number this type can represent
Source§

fn max_value() -> NotNan<T>

Returns the largest finite number this type can represent
Source§

impl<T> Clone for NotNan<T>
where T: Clone,

Source§

fn clone(&self) -> NotNan<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for NotNan<T>
where T: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> Default for NotNan<T>
where T: Default,

Source§

fn default() -> NotNan<T>

Returns the “default value” for a type. Read more
Source§

impl<T> Deref for NotNan<T>
where T: FloatCore,

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<NotNan<T> as Deref>::Target

Dereferences the value.
Source§

impl<T> Display for NotNan<T>
where T: FloatCore + Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> Div<&NotNan<T>> for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: &NotNan<T>) -> <NotNan<T> as Div<&NotNan<T>>>::Output

Performs the / operation. Read more
Source§

impl<T> Div<&T> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: &T) -> <&NotNan<T> as Div<&T>>::Output

Performs the / operation. Read more
Source§

impl<T> Div<&T> for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: &T) -> <NotNan<T> as Div<&T>>::Output

Performs the / operation. Read more
Source§

impl<T> Div<NotNan<T>> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: NotNan<T>) -> <&NotNan<T> as Div<NotNan<T>>>::Output

Performs the / operation. Read more
Source§

impl<T> Div<T> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: T) -> <&NotNan<T> as Div<T>>::Output

Performs the / operation. Read more
Source§

impl<T> Div<T> for NotNan<T>
where T: FloatCore,

Divides a float directly.

Panics if the provided value is NaN or the computation results in NaN

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: T) -> NotNan<T>

Performs the / operation. Read more
Source§

impl<T> Div for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: &NotNan<T>) -> <&NotNan<T> as Div>::Output

Performs the / operation. Read more
Source§

impl<T> Div for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: NotNan<T>) -> NotNan<T>

Performs the / operation. Read more
Source§

impl<T> DivAssign<&NotNan<T>> for NotNan<T>
where T: FloatCore + DivAssign,

Source§

fn div_assign(&mut self, other: &NotNan<T>)

Performs the /= operation. Read more
Source§

impl<T> DivAssign<&T> for NotNan<T>
where T: FloatCore + DivAssign,

Source§

fn div_assign(&mut self, other: &T)

Performs the /= operation. Read more
Source§

impl<T> DivAssign<T> for NotNan<T>
where T: FloatCore + DivAssign,

Source§

fn div_assign(&mut self, other: T)

Performs the /= operation. Read more
Source§

impl<T> DivAssign for NotNan<T>
where T: FloatCore + DivAssign,

Source§

fn div_assign(&mut self, other: NotNan<T>)

Performs the /= operation. Read more
Source§

impl<T> FloatConst for NotNan<T>
where T: FloatConst,

Source§

fn E() -> NotNan<T>

Return Euler’s number.
Source§

fn FRAC_1_PI() -> NotNan<T>

Return 1.0 / π.
Source§

fn FRAC_1_SQRT_2() -> NotNan<T>

Return 1.0 / sqrt(2.0).
Source§

fn FRAC_2_PI() -> NotNan<T>

Return 2.0 / π.
Source§

fn FRAC_2_SQRT_PI() -> NotNan<T>

Return 2.0 / sqrt(π).
Source§

fn FRAC_PI_2() -> NotNan<T>

Return π / 2.0.
Source§

fn FRAC_PI_3() -> NotNan<T>

Return π / 3.0.
Source§

fn FRAC_PI_4() -> NotNan<T>

Return π / 4.0.
Source§

fn FRAC_PI_6() -> NotNan<T>

Return π / 6.0.
Source§

fn FRAC_PI_8() -> NotNan<T>

Return π / 8.0.
Source§

fn LN_10() -> NotNan<T>

Return ln(10.0).
Source§

fn LN_2() -> NotNan<T>

Return ln(2.0).
Source§

fn LOG10_E() -> NotNan<T>

Return log10(e).
Source§

fn LOG2_E() -> NotNan<T>

Return log2(e).
Source§

fn PI() -> NotNan<T>

Return Archimedes’ constant π.
Source§

fn SQRT_2() -> NotNan<T>

Return sqrt(2.0).
Source§

fn TAU() -> Self
where Self: Sized + Add<Output = Self>,

Return the full circle constant τ.
Source§

fn LOG10_2() -> Self
where Self: Sized + Div<Output = Self>,

Return log10(2.0).
Source§

fn LOG2_10() -> Self
where Self: Sized + Div<Output = Self>,

Return log2(10.0).
Source§

impl From<NotNan<f32>> for NotNan<f64>

Source§

fn from(v: NotNan<f32>) -> NotNan<f64>

Converts to this type from the input type.
Source§

impl From<i16> for NotNan<f32>

Source§

fn from(source: i16) -> NotNan<f32>

Converts to this type from the input type.
Source§

impl From<i16> for NotNan<f64>

Source§

fn from(source: i16) -> NotNan<f64>

Converts to this type from the input type.
Source§

impl From<i32> for NotNan<f64>

Source§

fn from(source: i32) -> NotNan<f64>

Converts to this type from the input type.
Source§

impl From<i8> for NotNan<f32>

Source§

fn from(source: i8) -> NotNan<f32>

Converts to this type from the input type.
Source§

impl From<i8> for NotNan<f64>

Source§

fn from(source: i8) -> NotNan<f64>

Converts to this type from the input type.
Source§

impl From<u16> for NotNan<f32>

Source§

fn from(source: u16) -> NotNan<f32>

Converts to this type from the input type.
Source§

impl From<u16> for NotNan<f64>

Source§

fn from(source: u16) -> NotNan<f64>

Converts to this type from the input type.
Source§

impl From<u32> for NotNan<f64>

Source§

fn from(source: u32) -> NotNan<f64>

Converts to this type from the input type.
Source§

impl From<u8> for NotNan<f32>

Source§

fn from(source: u8) -> NotNan<f32>

Converts to this type from the input type.
Source§

impl From<u8> for NotNan<f64>

Source§

fn from(source: u8) -> NotNan<f64>

Converts to this type from the input type.
Source§

impl<T> FromPrimitive for NotNan<T>

Source§

fn from_i64(n: i64) -> Option<NotNan<T>>

Converts an i64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u64(n: u64) -> Option<NotNan<T>>

Converts an u64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_isize(n: isize) -> Option<NotNan<T>>

Converts an isize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i8(n: i8) -> Option<NotNan<T>>

Converts an i8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i16(n: i16) -> Option<NotNan<T>>

Converts an i16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_i32(n: i32) -> Option<NotNan<T>>

Converts an i32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_usize(n: usize) -> Option<NotNan<T>>

Converts a usize to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u8(n: u8) -> Option<NotNan<T>>

Converts an u8 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u16(n: u16) -> Option<NotNan<T>>

Converts an u16 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_u32(n: u32) -> Option<NotNan<T>>

Converts an u32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f32(n: f32) -> Option<NotNan<T>>

Converts a f32 to return an optional value of this type. If the value cannot be represented by this type, then None is returned.
Source§

fn from_f64(n: f64) -> Option<NotNan<T>>

Converts a f64 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_i128(n: i128) -> Option<Self>

Converts an i128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

fn from_u128(n: u128) -> Option<Self>

Converts an u128 to return an optional value of this type. If the value cannot be represented by this type, then None is returned. Read more
Source§

impl<T> FromStr for NotNan<T>
where T: FloatCore + FromStr,

Source§

fn from_str(src: &str) -> Result<NotNan<T>, <NotNan<T> as FromStr>::Err>

Convert a &str to NotNan. Returns an error if the string fails to parse, or if the resulting value is NaN

use ordered_float::NotNan;

assert!("-10".parse::<NotNan<f32>>().is_ok());
assert!("abc".parse::<NotNan<f32>>().is_err());
assert!("NaN".parse::<NotNan<f32>>().is_err());
Source§

type Err = ParseNotNanError<<T as FromStr>::Err>

The associated error which can be returned from parsing.
Source§

impl<T> Hash for NotNan<T>
where T: FloatCore,

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T> Mul<&NotNan<T>> for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &NotNan<T>) -> <NotNan<T> as Mul<&NotNan<T>>>::Output

Performs the * operation. Read more
Source§

impl<T> Mul<&T> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &T) -> <&NotNan<T> as Mul<&T>>::Output

Performs the * operation. Read more
Source§

impl<T> Mul<&T> for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &T) -> <NotNan<T> as Mul<&T>>::Output

Performs the * operation. Read more
Source§

impl<T> Mul<NotNan<T>> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: NotNan<T>) -> <&NotNan<T> as Mul<NotNan<T>>>::Output

Performs the * operation. Read more
Source§

impl<T> Mul<T> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: T) -> <&NotNan<T> as Mul<T>>::Output

Performs the * operation. Read more
Source§

impl<T> Mul<T> for NotNan<T>
where T: FloatCore,

Multiplies a float directly.

Panics if the provided value is NaN or the computation results in NaN

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: T) -> NotNan<T>

Performs the * operation. Read more
Source§

impl<T> Mul for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &NotNan<T>) -> <&NotNan<T> as Mul>::Output

Performs the * operation. Read more
Source§

impl<T> Mul for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: NotNan<T>) -> NotNan<T>

Performs the * operation. Read more
Source§

impl<T> MulAssign<&NotNan<T>> for NotNan<T>
where T: FloatCore + MulAssign,

Source§

fn mul_assign(&mut self, other: &NotNan<T>)

Performs the *= operation. Read more
Source§

impl<T> MulAssign<&T> for NotNan<T>
where T: FloatCore + MulAssign,

Source§

fn mul_assign(&mut self, other: &T)

Performs the *= operation. Read more
Source§

impl<T> MulAssign<T> for NotNan<T>
where T: FloatCore + MulAssign,

Source§

fn mul_assign(&mut self, other: T)

Performs the *= operation. Read more
Source§

impl<T> MulAssign for NotNan<T>
where T: FloatCore + MulAssign,

Source§

fn mul_assign(&mut self, other: NotNan<T>)

Performs the *= operation. Read more
Source§

impl<T> Neg for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> <&NotNan<T> as Neg>::Output

Performs the unary - operation. Read more
Source§

impl<T> Neg for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> NotNan<T>

Performs the unary - operation. Read more
Source§

impl<T> Num for NotNan<T>
where T: FloatCore,

Source§

type FromStrRadixErr = ParseNotNanError<<T as Num>::FromStrRadixErr>

Source§

fn from_str_radix( src: &str, radix: u32, ) -> Result<NotNan<T>, <NotNan<T> as Num>::FromStrRadixErr>

Convert from a string and radix (typically 2..=36). Read more
Source§

impl<T> NumCast for NotNan<T>
where T: FloatCore,

Source§

fn from<F>(n: F) -> Option<NotNan<T>>
where F: ToPrimitive,

Creates a number from another value that can be converted into a primitive via the ToPrimitive trait. If the source value cannot be represented by the target type, then None is returned. Read more
Source§

impl<T> One for NotNan<T>
where T: FloatCore,

Source§

fn one() -> NotNan<T>

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

fn is_one(&self) -> bool
where Self: PartialEq,

Returns true if self is equal to the multiplicative identity. Read more
Source§

impl<T> Ord for NotNan<T>
where T: FloatCore,

Source§

fn cmp(&self, other: &NotNan<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T> PartialEq<T> for NotNan<T>
where T: FloatCore,

Source§

fn eq(&self, other: &T) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> PartialEq for NotNan<T>
where T: PartialEq,

Source§

fn eq(&self, other: &NotNan<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> PartialOrd for NotNan<T>
where T: PartialOrd,

Source§

fn partial_cmp(&self, other: &NotNan<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a, 'b> Pow<&'a NotNan<f32>> for &'b NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a NotNan<f32>) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a NotNan<f32>> for &'b NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a NotNan<f32>) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a NotNan<f32>> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a NotNan<f32>) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a NotNan<f32>> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a NotNan<f32>) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a NotNan<f64>> for &'b NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a NotNan<f64>) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a NotNan<f64>> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a NotNan<f64>) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a f32> for &'b NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a f32) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a f32> for &'b NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a f32) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a f32> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a f32) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a f32> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a f32) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a f64> for &'b NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a f64) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a f64> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a f64) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a i16> for &'b NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a i16) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a i16> for &'b NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a i16) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a i16> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a i16) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a i16> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a i16) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a i32> for &'b NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a i32) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a i32> for &'b NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a i32) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a i32> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a i32) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a i32> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a i32) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a i8> for &'b NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a i8) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a i8> for &'b NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a i8) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a i8> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a i8) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a i8> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a i8) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a u16> for &'b NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a u16) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a u16> for &'b NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a u16) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a u16> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a u16) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a u16> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a u16) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a u8> for &'b NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a u8) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a, 'b> Pow<&'a u8> for &'b NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a u8) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a u8> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a u8) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<&'a u8> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: &'a u8) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<NotNan<f32>> for &'a NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: NotNan<f32>) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<NotNan<f32>> for &'a NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: NotNan<f32>) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl Pow<NotNan<f32>> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: NotNan<f32>) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl Pow<NotNan<f32>> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: NotNan<f32>) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<NotNan<f64>> for &'a NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: NotNan<f64>) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl Pow<NotNan<f64>> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: NotNan<f64>) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<f32> for &'a NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: f32) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<f32> for &'a NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: f32) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl Pow<f32> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: f32) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl Pow<f32> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: f32) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<f64> for &'a NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: f64) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl Pow<f64> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: f64) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<i16> for &'a NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: i16) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<i16> for &'a NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: i16) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl Pow<i16> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: i16) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl Pow<i16> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: i16) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<i32> for &'a NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: i32) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<i32> for &'a NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: i32) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl Pow<i32> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: i32) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl Pow<i32> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: i32) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<i8> for &'a NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: i8) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<i8> for &'a NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: i8) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl Pow<i8> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: i8) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl Pow<i8> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: i8) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<u16> for &'a NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: u16) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<u16> for &'a NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: u16) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl Pow<u16> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: u16) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl Pow<u16> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: u16) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<u8> for &'a NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: u8) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl<'a> Pow<u8> for &'a NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: u8) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl Pow<u8> for NotNan<f32>

Available on crate features std or libm only.
Source§

type Output = NotNan<f32>

The result after applying the operator.
Source§

fn pow(self, rhs: u8) -> NotNan<f32>

Returns self to the power rhs. Read more
Source§

impl Pow<u8> for NotNan<f64>

Available on crate features std or libm only.
Source§

type Output = NotNan<f64>

The result after applying the operator.
Source§

fn pow(self, rhs: u8) -> NotNan<f64>

Returns self to the power rhs. Read more
Source§

impl<'a, T> Product<&'a NotNan<T>> for NotNan<T>
where T: FloatCore + Product + 'a,

Source§

fn product<I>(iter: I) -> NotNan<T>
where I: Iterator<Item = &'a NotNan<T>>,

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<T> Product for NotNan<T>
where T: FloatCore + Product,

Source§

fn product<I>(iter: I) -> NotNan<T>
where I: Iterator<Item = NotNan<T>>,

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<T> Rem<&NotNan<T>> for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &NotNan<T>) -> <NotNan<T> as Rem<&NotNan<T>>>::Output

Performs the % operation. Read more
Source§

impl<T> Rem<&T> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &T) -> <&NotNan<T> as Rem<&T>>::Output

Performs the % operation. Read more
Source§

impl<T> Rem<&T> for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &T) -> <NotNan<T> as Rem<&T>>::Output

Performs the % operation. Read more
Source§

impl<T> Rem<NotNan<T>> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: NotNan<T>) -> <&NotNan<T> as Rem<NotNan<T>>>::Output

Performs the % operation. Read more
Source§

impl<T> Rem<T> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: T) -> <&NotNan<T> as Rem<T>>::Output

Performs the % operation. Read more
Source§

impl<T> Rem<T> for NotNan<T>
where T: FloatCore,

Calculates % with a float directly.

Panics if the provided value is NaN or the computation results in NaN

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: T) -> NotNan<T>

Performs the % operation. Read more
Source§

impl<T> Rem for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &NotNan<T>) -> <&NotNan<T> as Rem>::Output

Performs the % operation. Read more
Source§

impl<T> Rem for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: NotNan<T>) -> NotNan<T>

Performs the % operation. Read more
Source§

impl<T> RemAssign<&NotNan<T>> for NotNan<T>
where T: FloatCore + RemAssign,

Source§

fn rem_assign(&mut self, other: &NotNan<T>)

Performs the %= operation. Read more
Source§

impl<T> RemAssign<&T> for NotNan<T>
where T: FloatCore + RemAssign,

Source§

fn rem_assign(&mut self, other: &T)

Performs the %= operation. Read more
Source§

impl<T> RemAssign<T> for NotNan<T>
where T: FloatCore + RemAssign,

Source§

fn rem_assign(&mut self, other: T)

Performs the %= operation. Read more
Source§

impl<T> RemAssign for NotNan<T>
where T: FloatCore + RemAssign,

Source§

fn rem_assign(&mut self, other: NotNan<T>)

Performs the %= operation. Read more
Source§

impl<T> Signed for NotNan<T>
where T: FloatCore + Signed,

Source§

fn abs(&self) -> NotNan<T>

Computes the absolute value. Read more
Source§

fn abs_sub(&self, other: &NotNan<T>) -> NotNan<T>

The positive difference of two numbers. Read more
Source§

fn signum(&self) -> NotNan<T>

Returns the sign of the number. Read more
Source§

fn is_positive(&self) -> bool

Returns true if the number is positive and false if the number is zero or negative.
Source§

fn is_negative(&self) -> bool

Returns true if the number is negative and false if the number is zero or positive.
Source§

impl<T> Sub<&NotNan<T>> for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &NotNan<T>) -> <NotNan<T> as Sub<&NotNan<T>>>::Output

Performs the - operation. Read more
Source§

impl<T> Sub<&T> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &T) -> <&NotNan<T> as Sub<&T>>::Output

Performs the - operation. Read more
Source§

impl<T> Sub<&T> for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &T) -> <NotNan<T> as Sub<&T>>::Output

Performs the - operation. Read more
Source§

impl<T> Sub<NotNan<T>> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: NotNan<T>) -> <&NotNan<T> as Sub<NotNan<T>>>::Output

Performs the - operation. Read more
Source§

impl<T> Sub<T> for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: T) -> <&NotNan<T> as Sub<T>>::Output

Performs the - operation. Read more
Source§

impl<T> Sub<T> for NotNan<T>
where T: FloatCore,

Subtracts a float directly.

Panics if the provided value is NaN or the computation results in NaN

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: T) -> NotNan<T>

Performs the - operation. Read more
Source§

impl<T> Sub for &NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &NotNan<T>) -> <&NotNan<T> as Sub>::Output

Performs the - operation. Read more
Source§

impl<T> Sub for NotNan<T>
where T: FloatCore,

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: NotNan<T>) -> NotNan<T>

Performs the - operation. Read more
Source§

impl<T> SubAssign<&NotNan<T>> for NotNan<T>
where T: FloatCore + SubAssign,

Source§

fn sub_assign(&mut self, other: &NotNan<T>)

Performs the -= operation. Read more
Source§

impl<T> SubAssign<&T> for NotNan<T>
where T: FloatCore + SubAssign,

Source§

fn sub_assign(&mut self, other: &T)

Performs the -= operation. Read more
Source§

impl<T> SubAssign<T> for NotNan<T>
where T: FloatCore + SubAssign,

Source§

fn sub_assign(&mut self, other: T)

Performs the -= operation. Read more
Source§

impl<T> SubAssign for NotNan<T>
where T: FloatCore + SubAssign,

Source§

fn sub_assign(&mut self, other: NotNan<T>)

Performs the -= operation. Read more
Source§

impl<'a, T> Sum<&'a NotNan<T>> for NotNan<T>
where T: FloatCore + Sum + 'a,

Source§

fn sum<I>(iter: I) -> NotNan<T>
where I: Iterator<Item = &'a NotNan<T>>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<T> Sum for NotNan<T>
where T: FloatCore + Sum,

Adds a float directly.

Panics if the provided value is NaN.

Source§

fn sum<I>(iter: I) -> NotNan<T>
where I: Iterator<Item = NotNan<T>>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<T> ToPrimitive for NotNan<T>
where T: FloatCore,

Source§

fn to_i64(&self) -> Option<i64>

Converts the value of self to an i64. If the value cannot be represented by an i64, then None is returned.
Source§

fn to_u64(&self) -> Option<u64>

Converts the value of self to a u64. If the value cannot be represented by a u64, then None is returned.
Source§

fn to_isize(&self) -> Option<isize>

Converts the value of self to an isize. If the value cannot be represented by an isize, then None is returned.
Source§

fn to_i8(&self) -> Option<i8>

Converts the value of self to an i8. If the value cannot be represented by an i8, then None is returned.
Source§

fn to_i16(&self) -> Option<i16>

Converts the value of self to an i16. If the value cannot be represented by an i16, then None is returned.
Source§

fn to_i32(&self) -> Option<i32>

Converts the value of self to an i32. If the value cannot be represented by an i32, then None is returned.
Source§

fn to_usize(&self) -> Option<usize>

Converts the value of self to a usize. If the value cannot be represented by a usize, then None is returned.
Source§

fn to_u8(&self) -> Option<u8>

Converts the value of self to a u8. If the value cannot be represented by a u8, then None is returned.
Source§

fn to_u16(&self) -> Option<u16>

Converts the value of self to a u16. If the value cannot be represented by a u16, then None is returned.
Source§

fn to_u32(&self) -> Option<u32>

Converts the value of self to a u32. If the value cannot be represented by a u32, then None is returned.
Source§

fn to_f32(&self) -> Option<f32>

Converts the value of self to an f32. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f32.
Source§

fn to_f64(&self) -> Option<f64>

Converts the value of self to an f64. Overflows may map to positive or negative inifinity, otherwise None is returned if the value cannot be represented by an f64. Read more
Source§

fn to_i128(&self) -> Option<i128>

Converts the value of self to an i128. If the value cannot be represented by an i128 (i64 under the default implementation), then None is returned. Read more
Source§

fn to_u128(&self) -> Option<u128>

Converts the value of self to a u128. If the value cannot be represented by a u128 (u64 under the default implementation), then None is returned. Read more
Source§

impl TryFrom<f32> for NotNan<f32>

Source§

type Error = FloatIsNan

The type returned in the event of a conversion error.
Source§

fn try_from(v: f32) -> Result<NotNan<f32>, <NotNan<f32> as TryFrom<f32>>::Error>

Performs the conversion.
Source§

impl TryFrom<f64> for NotNan<f64>

Source§

type Error = FloatIsNan

The type returned in the event of a conversion error.
Source§

fn try_from(v: f64) -> Result<NotNan<f64>, <NotNan<f64> as TryFrom<f64>>::Error>

Performs the conversion.
Source§

impl<T> Zero for NotNan<T>
where T: FloatCore,

Source§

fn zero() -> NotNan<T>

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl<T> Copy for NotNan<T>
where T: Copy,

Source§

impl<T> Eq for NotNan<T>
where T: FloatCore + PartialEq,

Source§

impl<T> StructuralPartialEq for NotNan<T>

Auto Trait Implementations§

§

impl<T> Freeze for NotNan<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for NotNan<T>
where T: RefUnwindSafe,

§

impl<T> Send for NotNan<T>
where T: Send,

§

impl<T> Sync for NotNan<T>
where T: Sync,

§

impl<T> Unpin for NotNan<T>
where T: Unpin,

§

impl<T> UnwindSafe for NotNan<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> LowerBounded for T
where T: Bounded,

Source§

fn min_value() -> T

Returns the smallest finite number this type can represent
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> ToCompactString for T
where T: Display,

Source§

fn to_compact_string(&self) -> CompactString

Converts the given value to a CompactString. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UpperBounded for T
where T: Bounded,

Source§

fn max_value() -> T

Returns the largest finite number this type can represent
Source§

impl<T> NumAssign for T
where T: Num + NumAssignOps,

Source§

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Source§

impl<T> NumAssignRef for T
where T: NumAssign + for<'r> NumAssignOps<&'r T>,

Source§

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>,

Source§

impl<T> NumRef for T
where T: Num + for<'r> NumOps<&'r T>,

Source§

impl<T, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,