Struct real_float::Real
source · [−]#[repr(transparent)]pub struct Real<F: IsNan>(_);Implementations
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>
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 exp_m1(self) -> Self
pub fn exp_m1(self) -> Self
Computes e^(self) - 1 more accurately than performing the operations separately.
Panics
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.
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 sin_cos(self) -> (Self, Self)
pub fn sin_cos(self) -> (Self, Self)
Computes the sine and cosine of a number simultaneously.
Panics
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 result 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 asin(self) -> Self
pub fn asin(self) -> Self
Computes the arcsine of a number.
Panics
If the output is NaN (caused if the magnitude of the input exceeds 1).
sourcepub fn acos(self) -> Self
pub fn acos(self) -> Self
Computes the arccosine of a number.
Panics
If the output is NaN (caused if the magnitude of the input exceeds 1).
Trait Implementations
sourceimpl<F: IsNan + Add<Output = F>, Rhs: IntoInner<F>> AddAssign<Rhs> for Real<F>
impl<F: IsNan + Add<Output = F>, 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: IsNan + Div<Output = F>, Rhs: IntoInner<F>> DivAssign<Rhs> for Real<F>
impl<F: IsNan + Div<Output = F>, 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: IsNan + Mul<Output = F>, Rhs: IntoInner<F>> MulAssign<Rhs> for Real<F>
impl<F: IsNan + Mul<Output = F>, 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, Rhs: IntoInner<F> + Copy> PartialOrd<Rhs> for Real<F>
impl<F: IsNan + ToOrd, Rhs: IntoInner<F> + Copy> PartialOrd<Rhs> for Real<F>
sourcefn partial_cmp(&self, rhs: &Rhs) -> Option<Ordering>
fn partial_cmp(&self, rhs: &Rhs) -> 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 + Rem<Output = F>, Rhs: IntoInner<F>> RemAssign<Rhs> for Real<F>
impl<F: IsNan + Rem<Output = F>, 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: IsNan + Sub<Output = F>, Rhs: IntoInner<F>> SubAssign<Rhs> for Real<F>
impl<F: IsNan + Sub<Output = F>, 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