pub struct Real<F: IsNan>(/* private fields */);Implementations§
Source§impl<F: IsNan> Real<F>
impl<F: IsNan> Real<F>
Source§impl<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.
Source§impl<F: IsNan> Real<F>
impl<F: IsNan> Real<F>
Source§impl<F: IsNan> Real<F>
impl<F: IsNan> Real<F>
Source§impl<F: IsNan + Pow> Real<F>
impl<F: IsNan + Pow> Real<F>
Source§impl<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.
Source§impl<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§
Source§impl<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>
Source§fn add_assign(&mut self, rhs: Rhs)
fn add_assign(&mut self, rhs: Rhs)
+= operation. Read moreSource§impl<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>
Source§fn div_assign(&mut self, rhs: Rhs)
fn div_assign(&mut self, rhs: Rhs)
/= operation. Read moreSource§impl<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>
Source§fn mul_assign(&mut self, rhs: Rhs)
fn mul_assign(&mut self, rhs: Rhs)
*= operation. Read moreSource§impl<F: IsNan + ToOrd> Ord for Real<F>
impl<F: IsNan + ToOrd> Ord for Real<F>
Source§impl<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>
Source§impl<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>
Source§fn rem_assign(&mut self, rhs: Rhs)
fn rem_assign(&mut self, rhs: Rhs)
%= operation. Read moreSource§impl<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>
Source§fn sub_assign(&mut self, rhs: Rhs)
fn sub_assign(&mut self, rhs: Rhs)
-= operation. Read more