pub struct NoisyFloat<F: Float, C: FloatChecker<F>> { /* private fields */ }Expand description
A floating point number with a restricted set of legal values.
Typical users will not need to access this struct directly, but
can instead use the type aliases found in the module noisy_float::types.
However, this struct together with a FloatChecker implementation can be used
to define custom behavior.
The underlying float type is F, usually f32 or f64.
Valid values for the float are determined by the float checker C.
If an invalid value would ever be returned from a method on this type,
the method will panic instead, using either assert! or debug_assert!
as defined by the float checker.
The exception to this rule is for methods that return an Option containing
a NoisyFloat, in which case the result would be None if the value is invalid.
Implementations§
Source§impl NoisyFloat<f32, NumChecker>
impl NoisyFloat<f32, NumChecker>
Sourcepub const fn unchecked_new(value: f32) -> Self
pub const fn unchecked_new(value: f32) -> Self
A const constructor that does not check whether value is valid.
WARNING: This constructor does not panic even in debug mode.
As always, it is the user’s responsibility to ensure value is valid.
Until Rust supports panics in const functions, this constructor
is necessary to create a NoisyFloat in a const setting.
Source§impl NoisyFloat<f64, NumChecker>
impl NoisyFloat<f64, NumChecker>
Sourcepub const fn unchecked_new(value: f64) -> Self
pub const fn unchecked_new(value: f64) -> Self
A const constructor that does not check whether value is valid.
WARNING: This constructor does not panic even in debug mode.
As always, it is the user’s responsibility to ensure value is valid.
Until Rust supports panics in const functions, this constructor
is necessary to create a NoisyFloat in a const setting.
Source§impl NoisyFloat<f32, FiniteChecker>
impl NoisyFloat<f32, FiniteChecker>
Sourcepub const fn unchecked_new(value: f32) -> Self
pub const fn unchecked_new(value: f32) -> Self
A const constructor that does not check whether value is valid.
WARNING: This constructor does not panic even in debug mode.
As always, it is the user’s responsibility to ensure value is valid.
Until Rust supports panics in const functions, this constructor
is necessary to create a NoisyFloat in a const setting.
Source§impl NoisyFloat<f64, FiniteChecker>
impl NoisyFloat<f64, FiniteChecker>
Sourcepub const fn unchecked_new(value: f64) -> Self
pub const fn unchecked_new(value: f64) -> Self
A const constructor that does not check whether value is valid.
WARNING: This constructor does not panic even in debug mode.
As always, it is the user’s responsibility to ensure value is valid.
Until Rust supports panics in const functions, this constructor
is necessary to create a NoisyFloat in a const setting.
Source§impl<F: Float, C: FloatChecker<F>> NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> NoisyFloat<F, C>
Sourcepub fn new(value: F) -> Self
pub fn new(value: F) -> Self
Constructs a NoisyFloat with the given value.
Uses the FloatChecker to assert that the value is valid.
Sourcepub fn try_new(value: F) -> Option<Self>
pub fn try_new(value: F) -> Option<Self>
Tries to construct a NoisyFloat with the given value.
Returns None if the value is invalid.
Sourcepub fn borrowed(value: &F) -> &Self
pub fn borrowed(value: &F) -> &Self
Converts the value in-place to a reference to a NoisyFloat.
Uses the FloatChecker to assert that the value is valid.
Sourcepub fn try_borrowed(value: &F) -> Option<&Self>
pub fn try_borrowed(value: &F) -> Option<&Self>
Tries to convert the value in-place to a reference to a NoisyFloat.
Returns None if the value is invalid.
Sourcepub fn borrowed_mut(value: &mut F) -> &mut Self
pub fn borrowed_mut(value: &mut F) -> &mut Self
Converts the value in-place to a mutable reference to a NoisyFloat.
Uses the FloatChecker to assert that the value is valid.
Sourcepub fn try_borrowed_mut(value: &mut F) -> Option<&mut Self>
pub fn try_borrowed_mut(value: &mut F) -> Option<&mut Self>
Tries to convert the value in-place to a mutable reference to a NoisyFloat.
Returns None if the value is invalid.
Sourcepub fn from_f32(value: f32) -> Self
pub fn from_f32(value: f32) -> Self
Constructs a NoisyFloat with the given f32 value.
May panic not only by the FloatChecker but also
by unwrapping the result of a NumCast invocation for type F,
although the later should not occur in normal situations.
Sourcepub fn from_f64(value: f64) -> Self
pub fn from_f64(value: f64) -> Self
Constructs a NoisyFloat with the given f64 value.
May panic not only by the FloatChecker but also
by unwrapping the result of a NumCast invocation for type F,
although the later should not occur in normal situations.
Trait Implementations§
Source§impl<'a, F: Float, C: FloatChecker<F>> Add<&'a F> for NoisyFloat<F, C>
impl<'a, F: Float, C: FloatChecker<F>> Add<&'a F> for NoisyFloat<F, C>
Source§impl<'a, F: Float, C: FloatChecker<F>> Add<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<'a, F: Float, C: FloatChecker<F>> Add<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Add<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Add<F> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Add for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Add for NoisyFloat<F, C>
Source§impl<'a, F: Float + AddAssign, C: FloatChecker<F>> AddAssign<&'a F> for NoisyFloat<F, C>
impl<'a, F: Float + AddAssign, C: FloatChecker<F>> AddAssign<&'a F> for NoisyFloat<F, C>
Source§fn add_assign(&mut self, rhs: &'a F)
fn add_assign(&mut self, rhs: &'a F)
+= operation. Read moreSource§impl<'a, F: Float + AddAssign, C: FloatChecker<F>> AddAssign<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<'a, F: Float + AddAssign, C: FloatChecker<F>> AddAssign<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
Source§fn add_assign(&mut self, rhs: &'a Self)
fn add_assign(&mut self, rhs: &'a Self)
+= operation. Read moreSource§impl<F: Float + AddAssign, C: FloatChecker<F>> AddAssign<F> for NoisyFloat<F, C>
impl<F: Float + AddAssign, C: FloatChecker<F>> AddAssign<F> for NoisyFloat<F, C>
Source§fn add_assign(&mut self, rhs: F)
fn add_assign(&mut self, rhs: F)
+= operation. Read moreSource§impl<F: Float + AddAssign, C: FloatChecker<F>> AddAssign for NoisyFloat<F, C>
impl<F: Float + AddAssign, C: FloatChecker<F>> AddAssign for NoisyFloat<F, C>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl<F: Float, C: FloatChecker<F>> AsRef<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> AsRef<F> for NoisyFloat<F, C>
Source§impl<F: Float + Bounded, C: FloatChecker<F>> Bounded for NoisyFloat<F, C>
impl<F: Float + Bounded, C: FloatChecker<F>> Bounded for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Clone for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Clone for NoisyFloat<F, C>
Source§impl<F: Float + Debug, C: FloatChecker<F>> Debug for NoisyFloat<F, C>
impl<F: Float + Debug, C: FloatChecker<F>> Debug for NoisyFloat<F, C>
Source§impl<F: Float + Default, C: FloatChecker<F>> Default for NoisyFloat<F, C>
impl<F: Float + Default, C: FloatChecker<F>> Default for NoisyFloat<F, C>
Source§impl<'de, F: Float + Deserialize<'de>, C: FloatChecker<F>> Deserialize<'de> for NoisyFloat<F, C>
impl<'de, F: Float + Deserialize<'de>, C: FloatChecker<F>> Deserialize<'de> for NoisyFloat<F, C>
Source§fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
Source§impl<F: Float + Display, C: FloatChecker<F>> Display for NoisyFloat<F, C>
impl<F: Float + Display, C: FloatChecker<F>> Display for NoisyFloat<F, C>
Source§impl<'a, F: Float, C: FloatChecker<F>> Div<&'a F> for NoisyFloat<F, C>
impl<'a, F: Float, C: FloatChecker<F>> Div<&'a F> for NoisyFloat<F, C>
Source§impl<'a, F: Float, C: FloatChecker<F>> Div<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<'a, F: Float, C: FloatChecker<F>> Div<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Div<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Div<F> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Div for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Div for NoisyFloat<F, C>
Source§impl<'a, F: Float + DivAssign, C: FloatChecker<F>> DivAssign<&'a F> for NoisyFloat<F, C>
impl<'a, F: Float + DivAssign, C: FloatChecker<F>> DivAssign<&'a F> for NoisyFloat<F, C>
Source§fn div_assign(&mut self, rhs: &'a F)
fn div_assign(&mut self, rhs: &'a F)
/= operation. Read moreSource§impl<'a, F: Float + DivAssign, C: FloatChecker<F>> DivAssign<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<'a, F: Float + DivAssign, C: FloatChecker<F>> DivAssign<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
Source§fn div_assign(&mut self, rhs: &'a Self)
fn div_assign(&mut self, rhs: &'a Self)
/= operation. Read moreSource§impl<F: Float + DivAssign, C: FloatChecker<F>> DivAssign<F> for NoisyFloat<F, C>
impl<F: Float + DivAssign, C: FloatChecker<F>> DivAssign<F> for NoisyFloat<F, C>
Source§fn div_assign(&mut self, rhs: F)
fn div_assign(&mut self, rhs: F)
/= operation. Read moreSource§impl<F: Float + DivAssign, C: FloatChecker<F>> DivAssign for NoisyFloat<F, C>
impl<F: Float + DivAssign, C: FloatChecker<F>> DivAssign for NoisyFloat<F, C>
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/= operation. Read moreSource§impl<F: Float, C: FloatChecker<F>> Float for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Float for NoisyFloat<F, C>
Source§fn neg_infinity() -> Self
fn neg_infinity() -> Self
Source§fn min_value() -> Self
fn min_value() -> Self
Source§fn min_positive_value() -> Self
fn min_positive_value() -> Self
Source§fn max_value() -> Self
fn max_value() -> Self
Source§fn is_infinite(self) -> bool
fn is_infinite(self) -> bool
true if this value is positive infinity or negative infinity and
false otherwise. Read moreSource§fn classify(self) -> FpCategory
fn classify(self) -> FpCategory
Source§fn ceil(self) -> Self
fn ceil(self) -> Self
Source§fn round(self) -> Self
fn round(self) -> Self
0.0. Read moreSource§fn is_sign_positive(self) -> bool
fn is_sign_positive(self) -> bool
true if self is positive, including +0.0,
Float::infinity(), and since Rust 1.20 also Float::nan(). Read moreSource§fn is_sign_negative(self) -> bool
fn is_sign_negative(self) -> bool
true if self is negative, including -0.0,
Float::neg_infinity(), and since Rust 1.20 also -Float::nan(). Read moreSource§fn mul_add(self, a: Self, b: Self) -> Self
fn mul_add(self, a: Self, b: Self) -> Self
(self * a) + b with only one rounding
error, yielding a more accurate result than an unfused multiply-add. Read moreSource§fn log(self, base: Self) -> Self
fn log(self, base: Self) -> Self
Source§fn hypot(self, other: Self) -> Self
fn hypot(self, other: Self) -> Self
x and y. Read moreSource§fn asin(self) -> Self
fn asin(self) -> Self
Source§fn acos(self) -> Self
fn acos(self) -> Self
Source§fn atan(self) -> Self
fn atan(self) -> Self
Source§fn exp_m1(self) -> Self
fn exp_m1(self) -> Self
e^(self) - 1 in a way that is accurate even if the
number is close to zero. Read moreSource§fn ln_1p(self) -> Self
fn ln_1p(self) -> Self
ln(1+n) (natural logarithm) more accurately than if
the operations were performed separately. Read moreSource§fn integer_decode(self) -> (u64, i16, i8)
fn integer_decode(self) -> (u64, i16, i8)
sign * mantissa * 2 ^ exponent. Read moreSource§fn to_degrees(self) -> Self
fn to_degrees(self) -> Self
Source§fn to_radians(self) -> Self
fn to_radians(self) -> Self
Source§impl<F: Float + FloatConst, C: FloatChecker<F>> FloatConst for NoisyFloat<F, C>
impl<F: Float + FloatConst, C: FloatChecker<F>> FloatConst for NoisyFloat<F, C>
Source§fn FRAC_1_SQRT_2() -> Self
fn FRAC_1_SQRT_2() -> Self
1.0 / sqrt(2.0).Source§fn FRAC_2_SQRT_PI() -> Self
fn FRAC_2_SQRT_PI() -> Self
2.0 / sqrt(π).Source§impl<F: Float> From<NoisyFloat<F, FiniteChecker>> for NoisyFloat<F, NumChecker>
impl<F: Float> From<NoisyFloat<F, FiniteChecker>> for NoisyFloat<F, NumChecker>
Source§fn from(value: NoisyFloat<F, FiniteChecker>) -> Self
fn from(value: NoisyFloat<F, FiniteChecker>) -> Self
Source§impl<C: FloatChecker<f32>> From<NoisyFloat<f32, C>> for f32
impl<C: FloatChecker<f32>> From<NoisyFloat<f32, C>> for f32
Source§fn from(n: NoisyFloat<f32, C>) -> Self
fn from(n: NoisyFloat<f32, C>) -> Self
Source§impl<C: FloatChecker<f32>> From<NoisyFloat<f32, C>> for f64
impl<C: FloatChecker<f32>> From<NoisyFloat<f32, C>> for f64
Source§fn from(n: NoisyFloat<f32, C>) -> Self
fn from(n: NoisyFloat<f32, C>) -> Self
Source§impl<C: FloatChecker<f64>> From<NoisyFloat<f64, C>> for f64
impl<C: FloatChecker<f64>> From<NoisyFloat<f64, C>> for f64
Source§fn from(n: NoisyFloat<f64, C>) -> Self
fn from(n: NoisyFloat<f64, C>) -> Self
Source§impl<F: Float + FromPrimitive, C: FloatChecker<F>> FromPrimitive for NoisyFloat<F, C>
impl<F: Float + FromPrimitive, C: FloatChecker<F>> FromPrimitive for NoisyFloat<F, C>
Source§fn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
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>
fn from_i8(n: i8) -> Option<Self>
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>
fn from_i16(n: i16) -> Option<Self>
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>
fn from_i32(n: i32) -> Option<Self>
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_i64(n: i64) -> Option<Self>
fn from_i64(n: i64) -> Option<Self>
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_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
i128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§fn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
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>
fn from_u8(n: u8) -> Option<Self>
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>
fn from_u16(n: u16) -> Option<Self>
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>
fn from_u32(n: u32) -> Option<Self>
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_u64(n: u64) -> Option<Self>
fn from_u64(n: u64) -> Option<Self>
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_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
u128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§impl<C: FloatChecker<f32>> Hash for NoisyFloat<f32, C>
impl<C: FloatChecker<f32>> Hash for NoisyFloat<f32, C>
Source§impl<C: FloatChecker<f64>> Hash for NoisyFloat<f64, C>
impl<C: FloatChecker<f64>> Hash for NoisyFloat<f64, C>
Source§impl<F: Float + LowerExp, C: FloatChecker<F>> LowerExp for NoisyFloat<F, C>
impl<F: Float + LowerExp, C: FloatChecker<F>> LowerExp for NoisyFloat<F, C>
Source§impl<'a, F: Float, C: FloatChecker<F>> Mul<&'a F> for NoisyFloat<F, C>
impl<'a, F: Float, C: FloatChecker<F>> Mul<&'a F> for NoisyFloat<F, C>
Source§impl<'a, F: Float, C: FloatChecker<F>> Mul<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<'a, F: Float, C: FloatChecker<F>> Mul<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Mul<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Mul<F> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Mul for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Mul for NoisyFloat<F, C>
Source§impl<'a, F: Float + MulAssign, C: FloatChecker<F>> MulAssign<&'a F> for NoisyFloat<F, C>
impl<'a, F: Float + MulAssign, C: FloatChecker<F>> MulAssign<&'a F> for NoisyFloat<F, C>
Source§fn mul_assign(&mut self, rhs: &'a F)
fn mul_assign(&mut self, rhs: &'a F)
*= operation. Read moreSource§impl<'a, F: Float + MulAssign, C: FloatChecker<F>> MulAssign<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<'a, F: Float + MulAssign, C: FloatChecker<F>> MulAssign<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
Source§fn mul_assign(&mut self, rhs: &'a Self)
fn mul_assign(&mut self, rhs: &'a Self)
*= operation. Read moreSource§impl<F: Float + MulAssign, C: FloatChecker<F>> MulAssign<F> for NoisyFloat<F, C>
impl<F: Float + MulAssign, C: FloatChecker<F>> MulAssign<F> for NoisyFloat<F, C>
Source§fn mul_assign(&mut self, rhs: F)
fn mul_assign(&mut self, rhs: F)
*= operation. Read moreSource§impl<F: Float + MulAssign, C: FloatChecker<F>> MulAssign for NoisyFloat<F, C>
impl<F: Float + MulAssign, C: FloatChecker<F>> MulAssign for NoisyFloat<F, C>
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*= operation. Read moreSource§impl<'a, F: Float, C: FloatChecker<F>> Neg for &'a NoisyFloat<F, C>
impl<'a, F: Float, C: FloatChecker<F>> Neg for &'a NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Neg for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Neg for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Num for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Num for NoisyFloat<F, C>
type FromStrRadixErr = <F as Num>::FromStrRadixErr
Source§fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>
2..=36). Read moreSource§impl<F: Float, C: FloatChecker<F>> NumCast for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> NumCast for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> One for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> One for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Ord for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Ord for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> PartialEq<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> PartialEq<F> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> PartialEq for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> PartialEq for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> PartialOrd<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> PartialOrd<F> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> PartialOrd for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> PartialOrd for NoisyFloat<F, C>
Source§impl<'a, F: Float, C: FloatChecker<F>> Product<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<'a, F: Float, C: FloatChecker<F>> Product<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Product for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Product for NoisyFloat<F, C>
Source§impl<'a, F: Float, C: FloatChecker<F>> Rem<&'a F> for NoisyFloat<F, C>
impl<'a, F: Float, C: FloatChecker<F>> Rem<&'a F> for NoisyFloat<F, C>
Source§impl<'a, F: Float, C: FloatChecker<F>> Rem<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<'a, F: Float, C: FloatChecker<F>> Rem<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Rem<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Rem<F> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Rem for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Rem for NoisyFloat<F, C>
Source§impl<'a, F: Float + RemAssign, C: FloatChecker<F>> RemAssign<&'a F> for NoisyFloat<F, C>
impl<'a, F: Float + RemAssign, C: FloatChecker<F>> RemAssign<&'a F> for NoisyFloat<F, C>
Source§fn rem_assign(&mut self, rhs: &'a F)
fn rem_assign(&mut self, rhs: &'a F)
%= operation. Read moreSource§impl<'a, F: Float + RemAssign, C: FloatChecker<F>> RemAssign<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<'a, F: Float + RemAssign, C: FloatChecker<F>> RemAssign<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
Source§fn rem_assign(&mut self, rhs: &'a Self)
fn rem_assign(&mut self, rhs: &'a Self)
%= operation. Read moreSource§impl<F: Float + RemAssign, C: FloatChecker<F>> RemAssign<F> for NoisyFloat<F, C>
impl<F: Float + RemAssign, C: FloatChecker<F>> RemAssign<F> for NoisyFloat<F, C>
Source§fn rem_assign(&mut self, rhs: F)
fn rem_assign(&mut self, rhs: F)
%= operation. Read moreSource§impl<F: Float + RemAssign, C: FloatChecker<F>> RemAssign for NoisyFloat<F, C>
impl<F: Float + RemAssign, C: FloatChecker<F>> RemAssign for NoisyFloat<F, C>
Source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
%= operation. Read moreSource§impl<F: Float + Serialize, C: FloatChecker<F>> Serialize for NoisyFloat<F, C>
impl<F: Float + Serialize, C: FloatChecker<F>> Serialize for NoisyFloat<F, C>
Source§impl<F: Float + Signed, C: FloatChecker<F>> Signed for NoisyFloat<F, C>
impl<F: Float + Signed, C: FloatChecker<F>> Signed for NoisyFloat<F, C>
Source§fn is_positive(&self) -> bool
fn is_positive(&self) -> bool
Source§fn is_negative(&self) -> bool
fn is_negative(&self) -> bool
Source§impl<'a, F: Float, C: FloatChecker<F>> Sub<&'a F> for NoisyFloat<F, C>
impl<'a, F: Float, C: FloatChecker<F>> Sub<&'a F> for NoisyFloat<F, C>
Source§impl<'a, F: Float, C: FloatChecker<F>> Sub<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<'a, F: Float, C: FloatChecker<F>> Sub<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Sub<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Sub<F> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Sub for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Sub for NoisyFloat<F, C>
Source§impl<'a, F: Float + SubAssign, C: FloatChecker<F>> SubAssign<&'a F> for NoisyFloat<F, C>
impl<'a, F: Float + SubAssign, C: FloatChecker<F>> SubAssign<&'a F> for NoisyFloat<F, C>
Source§fn sub_assign(&mut self, rhs: &'a F)
fn sub_assign(&mut self, rhs: &'a F)
-= operation. Read moreSource§impl<'a, F: Float + SubAssign, C: FloatChecker<F>> SubAssign<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<'a, F: Float + SubAssign, C: FloatChecker<F>> SubAssign<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
Source§fn sub_assign(&mut self, rhs: &'a Self)
fn sub_assign(&mut self, rhs: &'a Self)
-= operation. Read moreSource§impl<F: Float + SubAssign, C: FloatChecker<F>> SubAssign<F> for NoisyFloat<F, C>
impl<F: Float + SubAssign, C: FloatChecker<F>> SubAssign<F> for NoisyFloat<F, C>
Source§fn sub_assign(&mut self, rhs: F)
fn sub_assign(&mut self, rhs: F)
-= operation. Read moreSource§impl<F: Float + SubAssign, C: FloatChecker<F>> SubAssign for NoisyFloat<F, C>
impl<F: Float + SubAssign, C: FloatChecker<F>> SubAssign for NoisyFloat<F, C>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read moreSource§impl<'a, F: Float, C: FloatChecker<F>> Sum<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<'a, F: Float, C: FloatChecker<F>> Sum<&'a NoisyFloat<F, C>> for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Sum for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Sum for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> ToPrimitive for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> ToPrimitive for NoisyFloat<F, C>
Source§fn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
self to an i64. If the value cannot be
represented by an i64, then None is returned.Source§fn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
self to a u64. If the value cannot be
represented by a u64, then None is returned.Source§fn to_isize(&self) -> Option<isize>
fn to_isize(&self) -> Option<isize>
self to an isize. If the value cannot be
represented by an isize, then None is returned.Source§fn to_i8(&self) -> Option<i8>
fn to_i8(&self) -> Option<i8>
self to an i8. If the value cannot be
represented by an i8, then None is returned.Source§fn to_i16(&self) -> Option<i16>
fn to_i16(&self) -> Option<i16>
self to an i16. If the value cannot be
represented by an i16, then None is returned.Source§fn to_i32(&self) -> Option<i32>
fn to_i32(&self) -> Option<i32>
self to an i32. If the value cannot be
represented by an i32, then None is returned.Source§fn to_usize(&self) -> Option<usize>
fn to_usize(&self) -> Option<usize>
self to a usize. If the value cannot be
represented by a usize, then None is returned.Source§fn to_u8(&self) -> Option<u8>
fn to_u8(&self) -> Option<u8>
self to a u8. If the value cannot be
represented by a u8, then None is returned.Source§fn to_u16(&self) -> Option<u16>
fn to_u16(&self) -> Option<u16>
self to a u16. If the value cannot be
represented by a u16, then None is returned.Source§fn to_u32(&self) -> Option<u32>
fn to_u32(&self) -> Option<u32>
self to a u32. If the value cannot be
represented by a u32, then None is returned.Source§fn to_f32(&self) -> Option<f32>
fn to_f32(&self) -> Option<f32>
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>
fn to_f64(&self) -> Option<f64>
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 moreSource§impl<C: FloatChecker<f32>> TryFrom<f32> for NoisyFloat<f32, C>
impl<C: FloatChecker<f32>> TryFrom<f32> for NoisyFloat<f32, C>
Source§impl<C: FloatChecker<f64>> TryFrom<f64> for NoisyFloat<f64, C>
impl<C: FloatChecker<f64>> TryFrom<f64> for NoisyFloat<f64, C>
Source§impl<F: Float + UpperExp, C: FloatChecker<F>> UpperExp for NoisyFloat<F, C>
impl<F: Float + UpperExp, C: FloatChecker<F>> UpperExp for NoisyFloat<F, C>
Source§impl<F: Float, C: FloatChecker<F>> Zero for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Zero for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Copy for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Eq for NoisyFloat<F, C>
Auto Trait Implementations§
impl<F, C> Freeze for NoisyFloat<F, C>where
F: Freeze,
impl<F, C> RefUnwindSafe for NoisyFloat<F, C>where
F: RefUnwindSafe,
C: RefUnwindSafe,
impl<F, C> Send for NoisyFloat<F, C>
impl<F, C> Sync for NoisyFloat<F, C>
impl<F, C> Unpin for NoisyFloat<F, C>
impl<F, C> UnwindSafe for NoisyFloat<F, C>where
F: UnwindSafe,
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LowerBounded for Twhere
T: Bounded,
impl<T> LowerBounded for Twhere
T: Bounded,
Source§impl<T> Real for Twhere
T: Float,
impl<T> Real for Twhere
T: Float,
Source§fn min_positive_value() -> T
fn min_positive_value() -> T
Source§fn round(self) -> T
fn round(self) -> T
0.0. Read moreSource§fn is_sign_positive(self) -> bool
fn is_sign_positive(self) -> bool
true if self is positive, including +0.0,
Float::infinity(), and with newer versions of Rust f64::NAN. Read moreSource§fn is_sign_negative(self) -> bool
fn is_sign_negative(self) -> bool
true if self is negative, including -0.0,
Float::neg_infinity(), and with newer versions of Rust -f64::NAN. Read moreSource§fn mul_add(self, a: T, b: T) -> T
fn mul_add(self, a: T, b: T) -> T
(self * a) + b with only one rounding
error, yielding a more accurate result than an unfused multiply-add. Read moreSource§fn log(self, base: T) -> T
fn log(self, base: T) -> T
Source§fn to_degrees(self) -> T
fn to_degrees(self) -> T
Source§fn to_radians(self) -> T
fn to_radians(self) -> T
Source§fn hypot(self, other: T) -> T
fn hypot(self, other: T) -> T
x and y. Read moreSource§fn asin(self) -> T
fn asin(self) -> T
Source§fn acos(self) -> T
fn acos(self) -> T
Source§fn atan(self) -> T
fn atan(self) -> T
Source§fn exp_m1(self) -> T
fn exp_m1(self) -> T
e^(self) - 1 in a way that is accurate even if the
number is close to zero. Read more