Struct real_float::Real
source · [−]#[repr(transparent)]pub struct Real<F: IsNan>(_);Implementations
sourceimpl<F: IsNan> Real<F>
impl<F: IsNan> Real<F>
sourceimpl<F: IsNan + Signed> Real<F>
impl<F: IsNan + Signed> Real<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,+0.0orINFINITY-1.0if the number is negative,-0.0orNEG_INFINITY
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: IsNan> Real<F>
impl<F: IsNan> Real<F>
sourceimpl<F: IsNan> Real<F>
impl<F: IsNan> Real<F>
sourceimpl<F: IsNan + Pow> Real<F>
impl<F: IsNan + Pow> Real<F>
sourcepub fn try_hypot(self, other: impl IntoInner<F>) -> Result<Self, NanError>
pub fn try_hypot(self, other: impl IntoInner<F>) -> Result<Self, NanError>
Attempts to calculate the length of the hypotenuse of a
right-angle triangle given legs of length x and y.
Errors
If the result is NaN.
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: IsNan + Exp> Real<F>
impl<F: IsNan + Exp> Real<F>
sourcepub fn try_exp_m1(self) -> Result<Self, NanError>
pub fn try_exp_m1(self) -> Result<Self, NanError>
Attempts to find e^(self) - 1 in a way that is accurate even if the number is close to zero.
Errors
If the result is NaN.
sourcepub fn try_ln_1p(self) -> Result<Self, NanError>
pub fn try_ln_1p(self) -> Result<Self, NanError>
Attempts to find ln(1+n) (natural logarithm) more accurately than if the operations were performed separately.
Errors
If the result is NaN.
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: IsNan + Trig> Real<F>
impl<F: IsNan + Trig> Real<F>
sourcepub fn try_sin(self) -> Result<Self, NanError>
pub fn try_sin(self) -> Result<Self, NanError>
Attempts to compute the sine of a number (in radians).
Errors
If the output is NaN (caused if the input is ±infinity).
sourcepub fn try_cos(self) -> Result<Self, NanError>
pub fn try_cos(self) -> Result<Self, NanError>
Attempts to compute the cosine of a number (in radians).
Errors
If the output is NaN (caused if the input is ±infinity).
sourcepub fn try_sin_cos(self) -> Result<(Self, Self), NanError>
pub fn try_sin_cos(self) -> Result<(Self, Self), NanError>
Attempts to compute both the sine and cosine of a number simultaneously (in radians).
Errors
If the output is NaN (caused if the input is ±infinity).
sourcepub fn try_tan(self) -> Result<Self, NanError>
pub fn try_tan(self) -> Result<Self, NanError>
Attempts to compute the tangent of a number (in radians).
Errors
If the output is NaN (caused if the input is ±infinity).
sourcepub fn try_asin(self) -> Result<Self, NanError>
pub fn try_asin(self) -> Result<Self, NanError>
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, NanError>
pub fn try_acos(self) -> Result<Self, NanError>
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, NanError>
pub fn try_atan2(self, other: impl IntoInner<F>) -> Result<Self, NanError>
Attempts to ompute the four quadrant arctangent of self (y) and other (x) in radians.
Errors
If the output is NaN.
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 + IsNan, Rhs: IntoInner<F>> AddAssign<Rhs> for Real<F>
impl<F: AddAssign + IsNan, Rhs: IntoInner<F>> AddAssign<Rhs> for Real<F>
sourcefn add_assign(&mut self, rhs: Rhs)
fn add_assign(&mut self, rhs: Rhs)
Performs the += operation. Read more
sourceimpl<F: DivAssign + IsNan, Rhs: IntoInner<F>> DivAssign<Rhs> for Real<F>
impl<F: DivAssign + IsNan, Rhs: IntoInner<F>> DivAssign<Rhs> for Real<F>
sourcefn div_assign(&mut self, rhs: Rhs)
fn div_assign(&mut self, rhs: Rhs)
Performs the /= operation. Read more
sourceimpl<F: MulAssign + IsNan, Rhs: IntoInner<F>> MulAssign<Rhs> for Real<F>
impl<F: MulAssign + IsNan, Rhs: IntoInner<F>> MulAssign<Rhs> for Real<F>
sourcefn mul_assign(&mut self, rhs: Rhs)
fn mul_assign(&mut self, rhs: Rhs)
Performs the *= operation. Read more
sourceimpl<F: IsNan + ToOrd> Ord for Real<F>
impl<F: IsNan + ToOrd> Ord for Real<F>
sourceimpl<F: IsNan + ToOrd> PartialOrd<F> for Real<F>
impl<F: IsNan + ToOrd> PartialOrd<F> for Real<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: IsNan + ToOrd> PartialOrd<Real<F>> for Real<F>
impl<F: IsNan + ToOrd> PartialOrd<Real<F>> for Real<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 + IsNan, Rhs: IntoInner<F>> RemAssign<Rhs> for Real<F>
impl<F: RemAssign + IsNan, Rhs: IntoInner<F>> RemAssign<Rhs> for Real<F>
sourcefn rem_assign(&mut self, rhs: Rhs)
fn rem_assign(&mut self, rhs: Rhs)
Performs the %= operation. Read more
sourceimpl<F: SubAssign + IsNan, Rhs: IntoInner<F>> SubAssign<Rhs> for Real<F>
impl<F: SubAssign + IsNan, Rhs: IntoInner<F>> SubAssign<Rhs> for Real<F>
sourcefn sub_assign(&mut self, rhs: Rhs)
fn sub_assign(&mut self, rhs: Rhs)
Performs the -= operation. Read more
impl<F: Copy + IsNan> Copy for Real<F>
impl<F: IsNan + ToOrd> Eq for Real<F>
Auto Trait Implementations
impl<F> RefUnwindSafe for Real<F> where
F: RefUnwindSafe,
impl<F> Send for Real<F> where
F: Send,
impl<F> Sync for Real<F> where
F: Sync,
impl<F> Unpin for Real<F> where
F: Unpin,
impl<F> UnwindSafe for Real<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