Struct real_float::Finite
source · [−]#[repr(transparent)]pub struct Finite<F: IsFinite>(_);Implementations
sourceimpl<F: IsFinite> Finite<F>
impl<F: IsFinite> Finite<F>
sourceimpl<F: IsFinite + Signed> Finite<F>
impl<F: IsFinite + Signed> Finite<F>
sourcepub fn signum(self) -> Self
pub fn signum(self) -> Self
Returns a number that represents the sign of self.
1.0if the number is positive or+0.0.-1.0if the number is negative or-0.0.
sourcepub fn is_sign_negative(self) -> bool
pub fn is_sign_negative(self) -> bool
Returns true if self has a negative sign, including -0.0 and negative infinity.
sourcepub fn is_sign_positive(self) -> bool
pub fn is_sign_positive(self) -> bool
Returns true if self has a positive sign, including +0.0 and positive infinity.
sourceimpl<F: IsFinite> Finite<F>
impl<F: IsFinite> Finite<F>
sourcepub fn try_add(self, rhs: impl IntoInner<F>) -> Result<Self, InfiniteError> where
F: Add<Output = F>,
pub fn try_add(self, rhs: impl IntoInner<F>) -> Result<Self, InfiniteError> where
F: Add<Output = F>,
sourceimpl<F: IsFinite> Finite<F>
impl<F: IsFinite> Finite<F>
sourcepub fn try_mul(self, rhs: impl IntoInner<F>) -> Result<Self, InfiniteError> where
F: Mul<Output = F>,
pub fn try_mul(self, rhs: impl IntoInner<F>) -> Result<Self, InfiniteError> where
F: Mul<Output = F>,
sourcepub fn try_div(self, rhs: impl IntoInner<F>) -> Result<Self, InfiniteError> where
F: Div<Output = F>,
pub fn try_div(self, rhs: impl IntoInner<F>) -> Result<Self, InfiniteError> where
F: Div<Output = F>,
sourceimpl<F: IsFinite + Pow> Finite<F>
impl<F: IsFinite + Pow> Finite<F>
sourcepub fn try_powf(self, n: impl IntoInner<F>) -> Result<Self, InfiniteError>
pub fn try_powf(self, n: impl IntoInner<F>) -> Result<Self, InfiniteError>
sourcepub fn try_powi(self, n: i32) -> Result<Self, InfiniteError>
pub fn try_powi(self, n: i32) -> Result<Self, InfiniteError>
sourcepub fn try_recip(self) -> Result<Self, InfiniteError>
pub fn try_recip(self) -> Result<Self, InfiniteError>
sourcepub fn try_sqrt(self) -> Result<Self, InfiniteError>
pub fn try_sqrt(self) -> Result<Self, InfiniteError>
sourcepub fn try_cbrt(self) -> Result<Self, InfiniteError>
pub fn try_cbrt(self) -> Result<Self, InfiniteError>
sourcepub fn try_hypot(self, other: impl IntoInner<F>) -> Result<Self, InfiniteError>
pub fn try_hypot(self, other: impl IntoInner<F>) -> Result<Self, InfiniteError>
Attempts to calculate the length of the hypotenuse of a
right-angle triangle given legs of length x and y.
Errors
If the output is non-finite.
pub fn powf(self, n: impl IntoInner<F>) -> Self
pub fn powi(self, n: i32) -> Self
pub fn recip(self) -> Self
pub fn sqrt(self) -> Self
pub fn cbrt(self) -> Self
pub fn hypot(self, other: impl IntoInner<F>) -> Self
sourceimpl<F: IsFinite + Exp> Finite<F>
impl<F: IsFinite + Exp> Finite<F>
sourcepub fn try_exp(self) -> Result<Self, InfiniteError>
pub fn try_exp(self) -> Result<Self, InfiniteError>
sourcepub fn try_exp2(self) -> Result<Self, InfiniteError>
pub fn try_exp2(self) -> Result<Self, InfiniteError>
sourcepub fn try_exp_m1(self) -> Result<Self, InfiniteError>
pub fn try_exp_m1(self) -> Result<Self, InfiniteError>
Attempts to find e^(self) - 1 in a way that is accurate even if the number is close to zero.
Errors
If the output is non-finite.
sourcepub fn try_log(self, b: impl IntoInner<F>) -> Result<Self, InfiniteError>
pub fn try_log(self, b: impl IntoInner<F>) -> Result<Self, InfiniteError>
sourcepub fn try_ln(self) -> Result<Self, InfiniteError>
pub fn try_ln(self) -> Result<Self, InfiniteError>
sourcepub fn try_log2(self) -> Result<Self, InfiniteError>
pub fn try_log2(self) -> Result<Self, InfiniteError>
sourcepub fn try_log10(self) -> Result<Self, InfiniteError>
pub fn try_log10(self) -> Result<Self, InfiniteError>
sourcepub fn try_ln_1p(self) -> Result<Self, InfiniteError>
pub fn try_ln_1p(self) -> Result<Self, InfiniteError>
Attempts to find ln(1+n) (natural logarithm) more accurately than if the operations were performed separately.
Errors
If the output is non-finite.
pub fn exp(self) -> Self
pub fn exp2(self) -> Self
pub fn exp_m1(self) -> Self
pub fn log(self, base: impl IntoInner<F>) -> Self
pub fn ln(self) -> Self
pub fn log2(self) -> Self
pub fn log10(self) -> Self
pub fn ln_1p(self) -> Self
sourceimpl<F: IsFinite + Trig> Finite<F>
impl<F: IsFinite + Trig> Finite<F>
sourcepub fn try_tan(self) -> Result<Self, InfiniteError>
pub fn try_tan(self) -> Result<Self, InfiniteError>
sourcepub fn try_asin(self) -> Result<Self, InfiniteError>
pub fn try_asin(self) -> Result<Self, InfiniteError>
Attempts to compute the arcsine of a number (in radians).
Errors
If the output is NaN (caused if the magnitude of the input exceeds 1).
sourcepub fn try_acos(self) -> Result<Self, InfiniteError>
pub fn try_acos(self) -> Result<Self, InfiniteError>
Attempts to compute the arccosine of a number (in radians).
Errors
If the output is NaN (caused if the magnitude of the input exceeds 1).
sourcepub fn try_atan2(self, other: impl IntoInner<F>) -> Result<Self, InfiniteError>
pub fn try_atan2(self, other: impl IntoInner<F>) -> Result<Self, InfiniteError>
Attempts to ompute the four quadrant arctangent of self (y) and other (x) in radians.
Errors
If the output is NaN or non-finite.
pub fn sin(self) -> Self
pub fn cos(self) -> Self
pub fn sin_cos(self) -> (Self, Self)
pub fn tan(self) -> Self
pub fn asin(self) -> Self
pub fn acos(self) -> Self
pub fn atan(self) -> Self
pub fn atan2(self, other: impl IntoInner<F>) -> Self
Trait Implementations
sourceimpl<F: AddAssign + IsFinite, Rhs: IntoInner<F>> AddAssign<Rhs> for Finite<F>
impl<F: AddAssign + IsFinite, Rhs: IntoInner<F>> AddAssign<Rhs> for Finite<F>
sourcefn add_assign(&mut self, rhs: Rhs)
fn add_assign(&mut self, rhs: Rhs)
Performs the += operation. Read more
sourceimpl<F: DivAssign + IsFinite, Rhs: IntoInner<F>> DivAssign<Rhs> for Finite<F>
impl<F: DivAssign + IsFinite, Rhs: IntoInner<F>> DivAssign<Rhs> for Finite<F>
sourcefn div_assign(&mut self, rhs: Rhs)
fn div_assign(&mut self, rhs: Rhs)
Performs the /= operation. Read more
sourceimpl<F: MulAssign + IsFinite, Rhs: IntoInner<F>> MulAssign<Rhs> for Finite<F>
impl<F: MulAssign + IsFinite, Rhs: IntoInner<F>> MulAssign<Rhs> for Finite<F>
sourcefn mul_assign(&mut self, rhs: Rhs)
fn mul_assign(&mut self, rhs: Rhs)
Performs the *= operation. Read more
sourceimpl<F: IsFinite + ToOrd> Ord for Finite<F>
impl<F: IsFinite + ToOrd> Ord for Finite<F>
sourceimpl<F: IsFinite + ToOrd> PartialOrd<F> for Finite<F>
impl<F: IsFinite + ToOrd> PartialOrd<F> for Finite<F>
sourcefn partial_cmp(&self, rhs: &F) -> Option<Ordering>
fn partial_cmp(&self, rhs: &F) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<F: IsFinite + ToOrd> PartialOrd<Finite<F>> for Finite<F>
impl<F: IsFinite + ToOrd> PartialOrd<Finite<F>> for Finite<F>
sourcefn partial_cmp(&self, rhs: &Self) -> Option<Ordering>
fn partial_cmp(&self, rhs: &Self) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
sourceimpl<F: RemAssign + IsFinite, Rhs: IntoInner<F>> RemAssign<Rhs> for Finite<F>
impl<F: RemAssign + IsFinite, Rhs: IntoInner<F>> RemAssign<Rhs> for Finite<F>
sourcefn rem_assign(&mut self, rhs: Rhs)
fn rem_assign(&mut self, rhs: Rhs)
Performs the %= operation. Read more
sourceimpl<F: SubAssign + IsFinite, Rhs: IntoInner<F>> SubAssign<Rhs> for Finite<F>
impl<F: SubAssign + IsFinite, Rhs: IntoInner<F>> SubAssign<Rhs> for Finite<F>
sourcefn sub_assign(&mut self, rhs: Rhs)
fn sub_assign(&mut self, rhs: Rhs)
Performs the -= operation. Read more
impl<F: Copy + IsFinite> Copy for Finite<F>
impl<F: IsFinite + ToOrd> Eq for Finite<F>
Auto Trait Implementations
impl<F> RefUnwindSafe for Finite<F> where
F: RefUnwindSafe,
impl<F> Send for Finite<F> where
F: Send,
impl<F> Sync for Finite<F> where
F: Sync,
impl<F> Unpin for Finite<F> where
F: Unpin,
impl<F> UnwindSafe for Finite<F> where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more