pub type Real<T, D = OrPanic> = Constrained<T, IsReal<D>>;Expand description
IEEE 754 floating-point representation that must be a real number.
Aliased Type§
pub struct Real<T, D = OrPanic> { /* private fields */ }Trait Implementations§
Source§impl<D> Real for Real<f32, D>
impl<D> Real for Real<f32, D>
Source§fn max_value() -> Self
fn max_value() -> Self
Returns the largest finite value that this type can represent. Read more
Source§fn min_value() -> Self
fn min_value() -> Self
Returns the smallest finite value that this type can represent. Read more
Source§fn min_positive_value() -> Self
fn min_positive_value() -> Self
Returns the smallest positive, normalized value that this type can represent. Read more
Source§fn is_sign_positive(self) -> bool
fn is_sign_positive(self) -> bool
Returns
true if self is positive, including +0.0,
Float::infinity(), and with newer versions of Rust f64::NAN. Read moreSource§fn is_sign_negative(self) -> bool
fn is_sign_negative(self) -> bool
Returns
true if self is negative, including -0.0,
Float::neg_infinity(), and with newer versions of Rust -f64::NAN. Read moreSource§fn ceil(self) -> Self
fn ceil(self) -> Self
Returns the smallest integer greater than or equal to a number. Read more
Source§fn round(self) -> Self
fn round(self) -> Self
Returns the nearest integer to a number. Round half-way cases away from
0.0. Read moreSource§fn mul_add(self, a: Self, b: Self) -> Self
fn mul_add(self, a: Self, b: Self) -> Self
Fused multiply-add. Computes
(self * a) + b with only one rounding
error, yielding a more accurate result than an unfused multiply-add. Read moreSource§fn exp_m1(self) -> Self
fn exp_m1(self) -> Self
Returns
e^(self) - 1 in a way that is accurate even if the
number is close to zero. Read moreSource§fn log(self, base: Self) -> Self
fn log(self, base: Self) -> Self
Returns the logarithm of the number with respect to an arbitrary base. Read more
Source§fn to_degrees(self) -> Self
fn to_degrees(self) -> Self
Converts radians to degrees. Read more
Source§fn to_radians(self) -> Self
fn to_radians(self) -> Self
Converts degrees to radians. Read more
Source§fn ln_1p(self) -> Self
fn ln_1p(self) -> Self
Returns
ln(1+n) (natural logarithm) more accurately than if
the operations were performed separately. Read moreSource§fn hypot(self, other: Self) -> Self
fn hypot(self, other: Self) -> Self
Calculate the length of the hypotenuse of a right-angle triangle given
legs of length
x and y. Read moreSource§fn asin(self) -> Self
fn asin(self) -> Self
Computes the arcsine of a number. Return value is in radians in
the range [-pi/2, pi/2] or NaN if the number is outside the range
[-1, 1]. Read more
Source§fn acos(self) -> Self
fn acos(self) -> Self
Computes the arccosine of a number. Return value is in radians in
the range [0, pi] or NaN if the number is outside the range
[-1, 1]. Read more
Source§fn atan(self) -> Self
fn atan(self) -> Self
Computes the arctangent of a number. Return value is in radians in the
range [-pi/2, pi/2]; Read more
Source§impl<D> Real for Real<f64, D>
impl<D> Real for Real<f64, D>
Source§fn max_value() -> Self
fn max_value() -> Self
Returns the largest finite value that this type can represent. Read more
Source§fn min_value() -> Self
fn min_value() -> Self
Returns the smallest finite value that this type can represent. Read more
Source§fn min_positive_value() -> Self
fn min_positive_value() -> Self
Returns the smallest positive, normalized value that this type can represent. Read more
Source§fn is_sign_positive(self) -> bool
fn is_sign_positive(self) -> bool
Returns
true if self is positive, including +0.0,
Float::infinity(), and with newer versions of Rust f64::NAN. Read moreSource§fn is_sign_negative(self) -> bool
fn is_sign_negative(self) -> bool
Returns
true if self is negative, including -0.0,
Float::neg_infinity(), and with newer versions of Rust -f64::NAN. Read moreSource§fn ceil(self) -> Self
fn ceil(self) -> Self
Returns the smallest integer greater than or equal to a number. Read more
Source§fn round(self) -> Self
fn round(self) -> Self
Returns the nearest integer to a number. Round half-way cases away from
0.0. Read moreSource§fn mul_add(self, a: Self, b: Self) -> Self
fn mul_add(self, a: Self, b: Self) -> Self
Fused multiply-add. Computes
(self * a) + b with only one rounding
error, yielding a more accurate result than an unfused multiply-add. Read moreSource§fn exp_m1(self) -> Self
fn exp_m1(self) -> Self
Returns
e^(self) - 1 in a way that is accurate even if the
number is close to zero. Read moreSource§fn log(self, base: Self) -> Self
fn log(self, base: Self) -> Self
Returns the logarithm of the number with respect to an arbitrary base. Read more
Source§fn to_degrees(self) -> Self
fn to_degrees(self) -> Self
Converts radians to degrees. Read more
Source§fn to_radians(self) -> Self
fn to_radians(self) -> Self
Converts degrees to radians. Read more
Source§fn ln_1p(self) -> Self
fn ln_1p(self) -> Self
Returns
ln(1+n) (natural logarithm) more accurately than if
the operations were performed separately. Read moreSource§fn hypot(self, other: Self) -> Self
fn hypot(self, other: Self) -> Self
Calculate the length of the hypotenuse of a right-angle triangle given
legs of length
x and y. Read moreSource§fn asin(self) -> Self
fn asin(self) -> Self
Computes the arcsine of a number. Return value is in radians in
the range [-pi/2, pi/2] or NaN if the number is outside the range
[-1, 1]. Read more
Source§fn acos(self) -> Self
fn acos(self) -> Self
Computes the arccosine of a number. Return value is in radians in
the range [0, pi] or NaN if the number is outside the range
[-1, 1]. Read more
Source§fn atan(self) -> Self
fn atan(self) -> Self
Computes the arctangent of a number. Return value is in radians in the
range [-pi/2, pi/2]; Read more
Source§impl<'a, D> TryFrom<&'a f32> for &'a Real<f32, D>where
D: Divergence,
impl<'a, D> TryFrom<&'a f32> for &'a Real<f32, D>where
D: Divergence,
Source§type Error = <<Constrained<f32, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error
type Error = <<Constrained<f32, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error
The type returned in the event of a conversion error.
Source§impl<'a, D> TryFrom<&'a f64> for &'a Real<f64, D>where
D: Divergence,
impl<'a, D> TryFrom<&'a f64> for &'a Real<f64, D>where
D: Divergence,
Source§type Error = <<Constrained<f64, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error
type Error = <<Constrained<f64, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error
The type returned in the event of a conversion error.
Source§impl<'a, D> TryFrom<&'a mut f32> for &'a mut Real<f32, D>where
D: Divergence,
impl<'a, D> TryFrom<&'a mut f32> for &'a mut Real<f32, D>where
D: Divergence,
Source§type Error = <<Constrained<f32, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error
type Error = <<Constrained<f32, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error
The type returned in the event of a conversion error.
Source§impl<'a, D> TryFrom<&'a mut f64> for &'a mut Real<f64, D>where
D: Divergence,
impl<'a, D> TryFrom<&'a mut f64> for &'a mut Real<f64, D>where
D: Divergence,
Source§type Error = <<Constrained<f64, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error
type Error = <<Constrained<f64, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error
The type returned in the event of a conversion error.
Source§impl<D> TryFrom<f32> for Real<f32, D>where
D: Divergence,
impl<D> TryFrom<f32> for Real<f32, D>where
D: Divergence,
Source§type Error = <<Constrained<f32, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error
type Error = <<Constrained<f32, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error
The type returned in the event of a conversion error.
Source§impl<D> TryFrom<f64> for Real<f64, D>where
D: Divergence,
impl<D> TryFrom<f64> for Real<f64, D>where
D: Divergence,
Source§type Error = <<Constrained<f64, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error
type Error = <<Constrained<f64, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error
The type returned in the event of a conversion error.