Real

Type Alias Real 

Source
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>
where D: Divergence, ContinueFor<D>: NonResidual<Self, ErrorFor<Self>>,

Source§

fn max_value() -> Self

Returns the largest finite value that this type can represent. Read more
Source§

fn min_value() -> Self

Returns the smallest finite value that this type can represent. Read more
Source§

fn min_positive_value() -> Self

Returns the smallest positive, normalized value that this type can represent. Read more
Source§

fn epsilon() -> Self

Returns epsilon, a small positive value. Read more
Source§

fn min(self, other: Self) -> Self

Returns the minimum of the two numbers. Read more
Source§

fn max(self, other: Self) -> Self

Returns the maximum of the two numbers. Read more
Source§

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 more
Source§

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 more
Source§

fn signum(self) -> Self

Returns a number that represents the sign of self. Read more
Source§

fn abs(self) -> Self

Computes the absolute value of self. Returns Float::nan() if the number is Float::nan(). Read more
Source§

fn floor(self) -> Self

Returns the largest integer less than or equal to a number. Read more
Source§

fn ceil(self) -> Self

Returns the smallest integer greater than or equal to a number. Read more
Source§

fn round(self) -> Self

Returns the nearest integer to a number. Round half-way cases away from 0.0. Read more
Source§

fn trunc(self) -> Self

Return the integer part of a number. Read more
Source§

fn fract(self) -> Self

Returns the fractional part of a number. Read more
Source§

fn recip(self) -> Self

Take the reciprocal (inverse) of a number, 1/x. Read more
Source§

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 more
Source§

fn abs_sub(self, other: Self) -> Self

The positive difference of two numbers. Read more
Source§

fn powi(self, n: i32) -> Self

Raise a number to an integer power. Read more
Source§

fn powf(self, n: Self) -> Self

Raise a number to a real number power. Read more
Source§

fn sqrt(self) -> Self

Take the square root of a number. Read more
Source§

fn cbrt(self) -> Self

Take the cubic root of a number. Read more
Source§

fn exp(self) -> Self

Returns e^(self), (the exponential function). Read more
Source§

fn exp2(self) -> Self

Returns 2^(self). Read more
Source§

fn exp_m1(self) -> Self

Returns e^(self) - 1 in a way that is accurate even if the number is close to zero. Read more
Source§

fn log(self, base: Self) -> Self

Returns the logarithm of the number with respect to an arbitrary base. Read more
Source§

fn ln(self) -> Self

Returns the natural logarithm of the number. Read more
Source§

fn log2(self) -> Self

Returns the base 2 logarithm of the number. Read more
Source§

fn log10(self) -> Self

Returns the base 10 logarithm of the number. Read more
Source§

fn to_degrees(self) -> Self

Converts radians to degrees. Read more
Source§

fn to_radians(self) -> Self

Converts degrees to radians. Read more
Source§

fn ln_1p(self) -> Self

Returns ln(1+n) (natural logarithm) more accurately than if the operations were performed separately. Read more
Source§

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 more
Source§

fn sin(self) -> Self

Computes the sine of a number (in radians). Read more
Source§

fn cos(self) -> Self

Computes the cosine of a number (in radians). Read more
Source§

fn tan(self) -> Self

Computes the tangent of a number (in radians). Read more
Source§

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

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

Computes the arctangent of a number. Return value is in radians in the range [-pi/2, pi/2]; Read more
Source§

fn atan2(self, other: Self) -> Self

Computes the four quadrant arctangent of self (y) and other (x). Read more
Source§

fn sin_cos(self) -> (Self, Self)

Simultaneously computes the sine and cosine of the number, x. Returns (sin(x), cos(x)). Read more
Source§

fn sinh(self) -> Self

Hyperbolic sine function. Read more
Source§

fn cosh(self) -> Self

Hyperbolic cosine function. Read more
Source§

fn tanh(self) -> Self

Hyperbolic tangent function. Read more
Source§

fn asinh(self) -> Self

Inverse hyperbolic sine function. Read more
Source§

fn acosh(self) -> Self

Inverse hyperbolic cosine function. Read more
Source§

fn atanh(self) -> Self

Inverse hyperbolic tangent function. Read more
Source§

impl<D> Real for Real<f64, D>
where D: Divergence, ContinueFor<D>: NonResidual<Self, ErrorFor<Self>>,

Source§

fn max_value() -> Self

Returns the largest finite value that this type can represent. Read more
Source§

fn min_value() -> Self

Returns the smallest finite value that this type can represent. Read more
Source§

fn min_positive_value() -> Self

Returns the smallest positive, normalized value that this type can represent. Read more
Source§

fn epsilon() -> Self

Returns epsilon, a small positive value. Read more
Source§

fn min(self, other: Self) -> Self

Returns the minimum of the two numbers. Read more
Source§

fn max(self, other: Self) -> Self

Returns the maximum of the two numbers. Read more
Source§

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 more
Source§

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 more
Source§

fn signum(self) -> Self

Returns a number that represents the sign of self. Read more
Source§

fn abs(self) -> Self

Computes the absolute value of self. Returns Float::nan() if the number is Float::nan(). Read more
Source§

fn floor(self) -> Self

Returns the largest integer less than or equal to a number. Read more
Source§

fn ceil(self) -> Self

Returns the smallest integer greater than or equal to a number. Read more
Source§

fn round(self) -> Self

Returns the nearest integer to a number. Round half-way cases away from 0.0. Read more
Source§

fn trunc(self) -> Self

Return the integer part of a number. Read more
Source§

fn fract(self) -> Self

Returns the fractional part of a number. Read more
Source§

fn recip(self) -> Self

Take the reciprocal (inverse) of a number, 1/x. Read more
Source§

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 more
Source§

fn abs_sub(self, other: Self) -> Self

The positive difference of two numbers. Read more
Source§

fn powi(self, n: i32) -> Self

Raise a number to an integer power. Read more
Source§

fn powf(self, n: Self) -> Self

Raise a number to a real number power. Read more
Source§

fn sqrt(self) -> Self

Take the square root of a number. Read more
Source§

fn cbrt(self) -> Self

Take the cubic root of a number. Read more
Source§

fn exp(self) -> Self

Returns e^(self), (the exponential function). Read more
Source§

fn exp2(self) -> Self

Returns 2^(self). Read more
Source§

fn exp_m1(self) -> Self

Returns e^(self) - 1 in a way that is accurate even if the number is close to zero. Read more
Source§

fn log(self, base: Self) -> Self

Returns the logarithm of the number with respect to an arbitrary base. Read more
Source§

fn ln(self) -> Self

Returns the natural logarithm of the number. Read more
Source§

fn log2(self) -> Self

Returns the base 2 logarithm of the number. Read more
Source§

fn log10(self) -> Self

Returns the base 10 logarithm of the number. Read more
Source§

fn to_degrees(self) -> Self

Converts radians to degrees. Read more
Source§

fn to_radians(self) -> Self

Converts degrees to radians. Read more
Source§

fn ln_1p(self) -> Self

Returns ln(1+n) (natural logarithm) more accurately than if the operations were performed separately. Read more
Source§

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 more
Source§

fn sin(self) -> Self

Computes the sine of a number (in radians). Read more
Source§

fn cos(self) -> Self

Computes the cosine of a number (in radians). Read more
Source§

fn tan(self) -> Self

Computes the tangent of a number (in radians). Read more
Source§

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

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

Computes the arctangent of a number. Return value is in radians in the range [-pi/2, pi/2]; Read more
Source§

fn atan2(self, other: Self) -> Self

Computes the four quadrant arctangent of self (y) and other (x). Read more
Source§

fn sin_cos(self) -> (Self, Self)

Simultaneously computes the sine and cosine of the number, x. Returns (sin(x), cos(x)). Read more
Source§

fn sinh(self) -> Self

Hyperbolic sine function. Read more
Source§

fn cosh(self) -> Self

Hyperbolic cosine function. Read more
Source§

fn tanh(self) -> Self

Hyperbolic tangent function. Read more
Source§

fn asinh(self) -> Self

Inverse hyperbolic sine function. Read more
Source§

fn acosh(self) -> Self

Inverse hyperbolic cosine function. Read more
Source§

fn atanh(self) -> Self

Inverse hyperbolic tangent function. Read more
Source§

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

The type returned in the event of a conversion error.
Source§

fn try_from(inner: &'a f32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

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

The type returned in the event of a conversion error.
Source§

fn try_from(inner: &'a f64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

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

The type returned in the event of a conversion error.
Source§

fn try_from(inner: &'a mut f32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

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

The type returned in the event of a conversion error.
Source§

fn try_from(inner: &'a mut f64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<D> TryFrom<f32> for Real<f32, D>
where D: Divergence,

Source§

type Error = <<Constrained<f32, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error

The type returned in the event of a conversion error.
Source§

fn try_from(inner: f32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<D> TryFrom<f64> for Real<f64, D>
where D: Divergence,

Source§

type Error = <<Constrained<f64, IsReal<D>> as ConstrainedProxy>::Constraint as Constraint>::Error

The type returned in the event of a conversion error.
Source§

fn try_from(inner: f64) -> Result<Self, Self::Error>

Performs the conversion.