ordered_float

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: FloatCore> NotNan<T>

Source

pub fn new(val: T) -> Result<Self, 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) -> Self

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) -> Self

👎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: FloatCore> Add<&NotNan<T>> for NotNan<T>

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: &Self) -> Self::Output

Performs the + operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: &T) -> Self::Output

Performs the + operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: &T) -> Self::Output

Performs the + operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: T) -> Self::Output

Performs the + operation. Read more
Source§

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

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) -> Self

Performs the + operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self::Output

Performs the + operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
Source§

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

Source§

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

Performs the += operation. Read more
Source§

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

Source§

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

Performs the += operation. Read more
Source§

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

Source§

fn add_assign(&mut self, other: T)

Performs the += operation. Read more
Source§

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

Source§

fn add_assign(&mut self, other: Self)

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 i16

Source§

fn as_(self) -> NotNan<f32>

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

impl AsPrimitive<NotNan<f32>> for i32

Source§

fn as_(self) -> NotNan<f32>

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

impl AsPrimitive<NotNan<f32>> for i64

Source§

fn as_(self) -> NotNan<f32>

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

impl AsPrimitive<NotNan<f32>> for i8

Source§

fn as_(self) -> NotNan<f32>

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

impl AsPrimitive<NotNan<f32>> for isize

Source§

fn as_(self) -> NotNan<f32>

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

impl AsPrimitive<NotNan<f32>> for u16

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<f32>> for u64

Source§

fn as_(self) -> NotNan<f32>

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

impl AsPrimitive<NotNan<f32>> for u8

Source§

fn as_(self) -> NotNan<f32>

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

impl AsPrimitive<NotNan<f32>> for usize

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 i16

Source§

fn as_(self) -> NotNan<f64>

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

impl AsPrimitive<NotNan<f64>> for i32

Source§

fn as_(self) -> NotNan<f64>

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

impl AsPrimitive<NotNan<f64>> for i64

Source§

fn as_(self) -> NotNan<f64>

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

impl AsPrimitive<NotNan<f64>> for i8

Source§

fn as_(self) -> NotNan<f64>

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

impl AsPrimitive<NotNan<f64>> for isize

Source§

fn as_(self) -> NotNan<f64>

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

impl AsPrimitive<NotNan<f64>> for u16

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<NotNan<f64>> for u64

Source§

fn as_(self) -> NotNan<f64>

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

impl AsPrimitive<NotNan<f64>> for u8

Source§

fn as_(self) -> NotNan<f64>

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

impl AsPrimitive<NotNan<f64>> for usize

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: FloatCore> AsRef<T> for NotNan<T>

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: FloatCore> Bounded for NotNan<T>

Source§

fn min_value() -> Self

Returns the smallest finite number this type can represent
Source§

fn max_value() -> Self

Returns the largest finite number this type can represent
Source§

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

Source§

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

Returns a copy 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> Debug for NotNan<T>

Source§

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

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

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

Source§

fn default() -> NotNan<T>

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

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

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

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

Source§

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

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

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

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: &Self) -> Self::Output

Performs the / operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: &T) -> Self::Output

Performs the / operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: &T) -> Self::Output

Performs the / operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: T) -> Self::Output

Performs the / operation. Read more
Source§

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

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) -> Self

Performs the / operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: Self) -> Self::Output

Performs the / operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: Self) -> Self

Performs the / operation. Read more
Source§

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

Source§

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

Performs the /= operation. Read more
Source§

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

Source§

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

Performs the /= operation. Read more
Source§

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

Source§

fn div_assign(&mut self, other: T)

Performs the /= operation. Read more
Source§

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

Source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
Source§

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

Source§

fn E() -> Self

Return Euler’s number.
Source§

fn FRAC_1_PI() -> Self

Return 1.0 / π.
Source§

fn FRAC_1_SQRT_2() -> Self

Return 1.0 / sqrt(2.0).
Source§

fn FRAC_2_PI() -> Self

Return 2.0 / π.
Source§

fn FRAC_2_SQRT_PI() -> Self

Return 2.0 / sqrt(π).
Source§

fn FRAC_PI_2() -> Self

Return π / 2.0.
Source§

fn FRAC_PI_3() -> Self

Return π / 3.0.
Source§

fn FRAC_PI_4() -> Self

Return π / 4.0.
Source§

fn FRAC_PI_6() -> Self

Return π / 6.0.
Source§

fn FRAC_PI_8() -> Self

Return π / 8.0.
Source§

fn LN_10() -> Self

Return ln(10.0).
Source§

fn LN_2() -> Self

Return ln(2.0).
Source§

fn LOG10_E() -> Self

Return log10(e).
Source§

fn LOG2_E() -> Self

Return log2(e).
Source§

fn PI() -> Self

Return Archimedes’ constant π.
Source§

fn SQRT_2() -> Self

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<NotNan<f32>> for f32

Source§

fn from(value: NotNan<f32>) -> Self

Converts to this type from the input type.
Source§

impl From<NotNan<f64>> for f64

Source§

fn from(value: NotNan<f64>) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for NotNan<f32>

Source§

fn from(source: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for NotNan<f64>

Source§

fn from(source: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for NotNan<f64>

Source§

fn from(source: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for NotNan<f32>

Source§

fn from(source: i8) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for NotNan<f64>

Source§

fn from(source: i8) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for NotNan<f32>

Source§

fn from(source: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for NotNan<f64>

Source§

fn from(source: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for NotNan<f64>

Source§

fn from(source: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for NotNan<f32>

Source§

fn from(source: u8) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for NotNan<f64>

Source§

fn from(source: u8) -> Self

Converts to this type from the input type.
Source§

impl<T: FloatCore + FromPrimitive> FromPrimitive for NotNan<T>

Source§

fn from_i64(n: i64) -> Option<Self>

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

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

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

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

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

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

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

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

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

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

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

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: FloatCore + FromStr> FromStr for NotNan<T>

Source§

fn from_str(src: &str) -> Result<Self, Self::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: FloatCore> Hash for NotNan<T>

Source§

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

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: FloatCore> Mul<&NotNan<T>> for NotNan<T>

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &Self) -> Self::Output

Performs the * operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &T) -> Self::Output

Performs the * operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: &T) -> Self::Output

Performs the * operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: T) -> Self::Output

Performs the * operation. Read more
Source§

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

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) -> Self

Performs the * operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Self) -> Self::Output

Performs the * operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Self) -> Self

Performs the * operation. Read more
Source§

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

Source§

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

Performs the *= operation. Read more
Source§

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

Source§

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

Performs the *= operation. Read more
Source§

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

Source§

fn mul_assign(&mut self, other: T)

Performs the *= operation. Read more
Source§

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

Source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

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

Source§

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

Source§

fn from_str_radix(src: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>

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

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

Source§

fn from<F: ToPrimitive>(n: F) -> Option<Self>

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: FloatCore> One for NotNan<T>

Source§

fn one() -> Self

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: FloatCore> Ord for NotNan<T>

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: FloatCore> PartialEq<T> for NotNan<T>

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> PartialEq for NotNan<T>

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> PartialOrd for NotNan<T>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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: FloatCore + Product + 'a> Product<&'a NotNan<T>> for NotNan<T>

Source§

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

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

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

Source§

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

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

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

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &Self) -> Self::Output

Performs the % operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &T) -> Self::Output

Performs the % operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: &T) -> Self::Output

Performs the % operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

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

Performs the % operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: T) -> Self::Output

Performs the % operation. Read more
Source§

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

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) -> Self

Performs the % operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: Self) -> Self::Output

Performs the % operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the % operator.
Source§

fn rem(self, other: Self) -> Self

Performs the % operation. Read more
Source§

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

Source§

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

Performs the %= operation. Read more
Source§

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

Source§

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

Performs the %= operation. Read more
Source§

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

Source§

fn rem_assign(&mut self, other: T)

Performs the %= operation. Read more
Source§

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

Source§

fn rem_assign(&mut self, other: Self)

Performs the %= operation. Read more
Source§

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

Source§

fn abs(&self) -> Self

Computes the absolute value. Read more
Source§

fn abs_sub(&self, other: &Self) -> Self

The positive difference of two numbers. Read more
Source§

fn signum(&self) -> Self

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: FloatCore> Sub<&NotNan<T>> for NotNan<T>

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &Self) -> Self::Output

Performs the - operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &T) -> Self::Output

Performs the - operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: &T) -> Self::Output

Performs the - operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: T) -> Self::Output

Performs the - operation. Read more
Source§

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

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) -> Self

Performs the - operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self::Output

Performs the - operation. Read more
Source§

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

Source§

type Output = NotNan<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
Source§

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

Source§

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

Performs the -= operation. Read more
Source§

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

Source§

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

Performs the -= operation. Read more
Source§

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

Source§

fn sub_assign(&mut self, other: T)

Performs the -= operation. Read more
Source§

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

Source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
Source§

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

Source§

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

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

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

Adds a float directly.

Panics if the provided value is NaN.

Source§

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

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

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

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<Self, Self::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<Self, Self::Error>

Performs the conversion.
Source§

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

Source§

fn zero() -> Self

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> Copy for NotNan<T>

Source§

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

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> LowerBounded for T
where T: Bounded,

Source§

fn min_value() -> T

Returns the smallest finite number this type can represent
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> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. 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>,