#[repr(transparent)]
pub struct Real<F: IsNan>(_);

Implementations

Creates a new Real float, panicking if it’s NaN.

Note that this function will not panic in release mode, unless the strict feature flag is set.

Attempts to create a new Real float.

Errors

If the number is NaN.

Gets the inner value of this number.

Computes the absolute value of self.

Returns a number that represents the sign of self.

  • 1.0 if the number is positive, +0.0 or INFINITY
  • -1.0 if the number is negative, -0.0 or NEG_INFINITY

Returns true if self has a negative sign, including -0.0 and negative infinity.

Returns true if self has a positive sign, including +0.0 and positive infinity.

Attempts to add two numbers.

Errors

If the result is NaN.

Attempts to subtract two numbers.

Errors

If the result is NaN.

Attempts to multiply two numbers.

Errors

If the result is NaN.

Attempts to divide self by another number.

Errors

If the result is NaN.

Attempts to find the remainder of self / rhs.

Errors

If the result is NaN.

Attempts to raise self to the power n.

Errors

If the result is NaN.

Attempts to raise self to the power n.

Errors

If the result is NaN.

Attempts to compute the reciprocal (1/x) of self.

Errors

If the result is NaN.

Attempts to find the square root of a number.

Errors

If the result is NaN.

Attempts to find the cube root of a number.

Errors

If the result is NaN.

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.

Attempts to find e^(self), the exponential function.

Errors

If the result is NaN.

Attempts to find 2^(self).

Errors

If the result is NaN.

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.

Attempts to find the log base b of self.

Errors

If the result is NaN.

Attempts to find the natural log (base e) of self.

Errors

If the result is NaN.

Attempts to find the log base 2 of self.

Errors

If the result is NaN.

Attempts to find the log base 10 of self.

Errors

If the result is NaN.

Attempts to find ln(1+n) (natural logarithm) more accurately than if the operations were performed separately.

Errors

If the result is NaN.

Attempts to compute the sine of a number (in radians).

Errors

If the output is NaN (caused if the input is ±infinity).

Attempts to compute the cosine of a number (in radians).

Errors

If the output is NaN (caused if the input is ±infinity).

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).

Attempts to compute the tangent of a number (in radians).

Errors

If the output is NaN (caused if the input is ±infinity).

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).

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).

Attempts to ompute the four quadrant arctangent of self (y) and other (x) in radians.

Errors

If the output is NaN.

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Performs the /= operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

The resulting type after applying the % operator.

Performs the % operation. Read more

Performs the %= operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.