Struct noisy_float::NoisyFloat
source · #[repr(transparent)]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
sourceimpl<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
sourceimpl<F: Float, C: FloatChecker<F>> Add<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Add<F> for NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
+
operator.sourceimpl<F: Float, C: FloatChecker<F>> Add<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Add<NoisyFloat<F, C>> for NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
+
operator.sourceimpl<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>
sourcefn add_assign(&mut self, rhs: F)
fn add_assign(&mut self, rhs: F)
+=
operation. Read moresourceimpl<F: Float + AddAssign, C: FloatChecker<F>> AddAssign<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float + AddAssign, C: FloatChecker<F>> AddAssign<NoisyFloat<F, C>> for NoisyFloat<F, C>
sourcefn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+=
operation. Read moresourceimpl<F: Float, C: FloatChecker<F>> AsRef<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> AsRef<F> for NoisyFloat<F, C>
sourceimpl<F: Float + Bounded, C: FloatChecker<F>> Bounded for NoisyFloat<F, C>
impl<F: Float + Bounded, C: FloatChecker<F>> Bounded for NoisyFloat<F, C>
sourceimpl<F: Float, C: FloatChecker<F>> Clone for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Clone for NoisyFloat<F, C>
sourceimpl<F: Float + Debug, C: FloatChecker<F>> Debug for NoisyFloat<F, C>
impl<F: Float + Debug, C: FloatChecker<F>> Debug for NoisyFloat<F, C>
sourceimpl<F: Float + Default, C: FloatChecker<F>> Default for NoisyFloat<F, C>
impl<F: Float + Default, C: FloatChecker<F>> Default for NoisyFloat<F, C>
sourceimpl<F: Float + Display, C: FloatChecker<F>> Display for NoisyFloat<F, C>
impl<F: Float + Display, C: FloatChecker<F>> Display for NoisyFloat<F, C>
sourceimpl<F: Float, C: FloatChecker<F>> Div<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Div<F> for NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
/
operator.sourceimpl<F: Float, C: FloatChecker<F>> Div<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Div<NoisyFloat<F, C>> for NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
/
operator.sourceimpl<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>
sourcefn div_assign(&mut self, rhs: F)
fn div_assign(&mut self, rhs: F)
/=
operation. Read moresourceimpl<F: Float + DivAssign, C: FloatChecker<F>> DivAssign<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float + DivAssign, C: FloatChecker<F>> DivAssign<NoisyFloat<F, C>> for NoisyFloat<F, C>
sourcefn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/=
operation. Read moresourceimpl<F: Float, C: FloatChecker<F>> Float for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Float for NoisyFloat<F, C>
sourcefn neg_infinity() -> Self
fn neg_infinity() -> Self
sourcefn min_value() -> Self
fn min_value() -> Self
sourcefn min_positive_value() -> Self
fn min_positive_value() -> Self
sourcefn max_value() -> Self
fn max_value() -> Self
sourcefn is_infinite(self) -> bool
fn is_infinite(self) -> bool
true
if this value is positive infinity or negative infinity and
false otherwise. Read moresourcefn classify(self) -> FpCategory
fn classify(self) -> FpCategory
sourcefn ceil(self) -> Self
fn ceil(self) -> Self
sourcefn round(self) -> Self
fn round(self) -> Self
0.0
. Read moresourcefn 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 moresourcefn 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 moresourcefn 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 moresourcefn log(self, base: Self) -> Self
fn log(self, base: Self) -> Self
sourcefn hypot(self, other: Self) -> Self
fn hypot(self, other: Self) -> Self
x
and y
. Read moresourcefn asin(self) -> Self
fn asin(self) -> Self
sourcefn acos(self) -> Self
fn acos(self) -> Self
sourcefn atan(self) -> Self
fn atan(self) -> Self
sourcefn sin_cos(self) -> (Self, Self)
fn sin_cos(self) -> (Self, Self)
sourcefn 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 moresourcefn ln_1p(self) -> Self
fn ln_1p(self) -> Self
ln(1+n)
(natural logarithm) more accurately than if
the operations were performed separately. Read moresourcefn integer_decode(self) -> (u64, i16, i8)
fn integer_decode(self) -> (u64, i16, i8)
sign * mantissa * 2 ^ exponent
. Read moresourcefn to_degrees(self) -> Self
fn to_degrees(self) -> Self
sourcefn to_radians(self) -> Self
fn to_radians(self) -> Self
sourceimpl<F: Float + FloatConst, C: FloatChecker<F>> FloatConst for NoisyFloat<F, C>
impl<F: Float + FloatConst, C: FloatChecker<F>> FloatConst for NoisyFloat<F, C>
sourcefn FRAC_1_SQRT_2() -> Self
fn FRAC_1_SQRT_2() -> Self
1.0 / sqrt(2.0)
.sourcefn FRAC_2_SQRT_PI() -> Self
fn FRAC_2_SQRT_PI() -> Self
2.0 / sqrt(π)
.sourceimpl<F: Float> From<NoisyFloat<F, FiniteChecker>> for NoisyFloat<F, NumChecker>
impl<F: Float> From<NoisyFloat<F, FiniteChecker>> for NoisyFloat<F, NumChecker>
sourcefn from(value: NoisyFloat<F, FiniteChecker>) -> Self
fn from(value: NoisyFloat<F, FiniteChecker>) -> Self
sourceimpl<F: Float + FromPrimitive, C: FloatChecker<F>> FromPrimitive for NoisyFloat<F, C>
impl<F: Float + FromPrimitive, C: FloatChecker<F>> FromPrimitive for NoisyFloat<F, C>
sourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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 moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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 moresourceimpl<C: FloatChecker<f32>> Hash for NoisyFloat<f32, C>
impl<C: FloatChecker<f32>> Hash for NoisyFloat<f32, C>
sourceimpl<C: FloatChecker<f64>> Hash for NoisyFloat<f64, C>
impl<C: FloatChecker<f64>> Hash for NoisyFloat<f64, C>
sourceimpl<F: Float + LowerExp, C: FloatChecker<F>> LowerExp for NoisyFloat<F, C>
impl<F: Float + LowerExp, C: FloatChecker<F>> LowerExp for NoisyFloat<F, C>
sourceimpl<F: Float, C: FloatChecker<F>> Mul<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Mul<F> for NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
*
operator.sourceimpl<F: Float, C: FloatChecker<F>> Mul<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Mul<NoisyFloat<F, C>> for NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
*
operator.sourceimpl<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>
sourcefn mul_assign(&mut self, rhs: F)
fn mul_assign(&mut self, rhs: F)
*=
operation. Read moresourceimpl<F: Float + MulAssign, C: FloatChecker<F>> MulAssign<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float + MulAssign, C: FloatChecker<F>> MulAssign<NoisyFloat<F, C>> for NoisyFloat<F, C>
sourcefn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*=
operation. Read moresourceimpl<F: Float, C: FloatChecker<F>> Neg for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Neg for NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
-
operator.sourceimpl<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
sourcefn 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 moresourceimpl<F: Float, C: FloatChecker<F>> NumCast for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> NumCast for NoisyFloat<F, C>
sourcefn from<T: ToPrimitive>(n: T) -> Option<Self>
fn from<T: ToPrimitive>(n: T) -> Option<Self>
ToPrimitive
trait. If the source value cannot be
represented by the target type, then None
is returned. Read moresourceimpl<F: Float, C: FloatChecker<F>> One for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> One for NoisyFloat<F, C>
sourceimpl<F: Float, C: FloatChecker<F>> Ord for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Ord for NoisyFloat<F, C>
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
sourceimpl<F: Float, C: FloatChecker<F>> PartialEq<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> PartialEq<F> for NoisyFloat<F, C>
sourceimpl<F: Float, C: FloatChecker<F>> PartialEq<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> PartialEq<NoisyFloat<F, C>> for NoisyFloat<F, C>
sourceimpl<F: Float, C: FloatChecker<F>> PartialOrd<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> PartialOrd<F> for NoisyFloat<F, C>
sourceimpl<F: Float, C: FloatChecker<F>> PartialOrd<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> PartialOrd<NoisyFloat<F, C>> for NoisyFloat<F, C>
sourceimpl<F: Float, C: FloatChecker<F>> Product<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Product<NoisyFloat<F, C>> for NoisyFloat<F, C>
sourceimpl<F: Float, C: FloatChecker<F>> Rem<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Rem<F> for NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
%
operator.sourceimpl<F: Float, C: FloatChecker<F>> Rem<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Rem<NoisyFloat<F, C>> for NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
%
operator.sourceimpl<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>
sourcefn rem_assign(&mut self, rhs: F)
fn rem_assign(&mut self, rhs: F)
%=
operation. Read moresourceimpl<F: Float + RemAssign, C: FloatChecker<F>> RemAssign<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float + RemAssign, C: FloatChecker<F>> RemAssign<NoisyFloat<F, C>> for NoisyFloat<F, C>
sourcefn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
%=
operation. Read moresourceimpl<F: Float + Signed, C: FloatChecker<F>> Signed for NoisyFloat<F, C>
impl<F: Float + Signed, C: FloatChecker<F>> Signed for NoisyFloat<F, C>
sourcefn is_positive(&self) -> bool
fn is_positive(&self) -> bool
sourcefn is_negative(&self) -> bool
fn is_negative(&self) -> bool
sourceimpl<F: Float, C: FloatChecker<F>> Sub<F> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Sub<F> for NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
-
operator.sourceimpl<F: Float, C: FloatChecker<F>> Sub<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Sub<NoisyFloat<F, C>> for NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
type Output = NoisyFloat<F, C>
-
operator.sourceimpl<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>
sourcefn sub_assign(&mut self, rhs: F)
fn sub_assign(&mut self, rhs: F)
-=
operation. Read moresourceimpl<F: Float + SubAssign, C: FloatChecker<F>> SubAssign<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float + SubAssign, C: FloatChecker<F>> SubAssign<NoisyFloat<F, C>> for NoisyFloat<F, C>
sourcefn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-=
operation. Read moresourceimpl<F: Float, C: FloatChecker<F>> Sum<NoisyFloat<F, C>> for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> Sum<NoisyFloat<F, C>> for NoisyFloat<F, C>
sourceimpl<F: Float, C: FloatChecker<F>> ToPrimitive for NoisyFloat<F, C>
impl<F: Float, C: FloatChecker<F>> ToPrimitive for NoisyFloat<F, C>
sourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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. Read moresourcefn 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
. Read moresourcefn 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 moresourceimpl<F: Float + UpperExp, C: FloatChecker<F>> UpperExp for NoisyFloat<F, C>
impl<F: Float + UpperExp, C: FloatChecker<F>> UpperExp for NoisyFloat<F, C>
sourceimpl<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> RefUnwindSafe for NoisyFloat<F, C>where
C: RefUnwindSafe,
F: RefUnwindSafe,
impl<F, C> Send for NoisyFloat<F, C>where
C: Send,
F: Send,
impl<F, C> Sync for NoisyFloat<F, C>where
C: Sync,
F: Sync,
impl<F, C> Unpin for NoisyFloat<F, C>where
C: Unpin,
F: Unpin,
impl<F, C> UnwindSafe for NoisyFloat<F, C>where
C: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> LowerBounded for Twhere
T: Bounded,
impl<T> LowerBounded for Twhere
T: Bounded,
sourceimpl<T> Real for Twhere
T: Float,
impl<T> Real for Twhere
T: Float,
sourcefn min_positive_value() -> T
fn min_positive_value() -> T
sourcefn round(self) -> T
fn round(self) -> T
0.0
. Read moresourcefn 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 moresourcefn 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 moresourcefn 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 moresourcefn log(self, base: T) -> T
fn log(self, base: T) -> T
sourcefn to_degrees(self) -> T
fn to_degrees(self) -> T
sourcefn to_radians(self) -> T
fn to_radians(self) -> T
sourcefn hypot(self, other: T) -> T
fn hypot(self, other: T) -> T
x
and y
. Read moresourcefn asin(self) -> T
fn asin(self) -> T
sourcefn acos(self) -> T
fn acos(self) -> T
sourcefn atan(self) -> T
fn atan(self) -> T
sourcefn 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