Struct wigner_symbols::SignedSqrt [] [src]

pub struct SignedSqrt(pub Rational);

Signed square root of a rational number

This represents a mathematical expression of the form s √(n / d) where

  • s is a sign (-1, 0, or +1),
  • n is a nonnegative numerator, and
  • d is a positive denominator.

Internally, it is represented by the rational number s × n / d.

This can be converted to a floating-point number via f64::from(…).

Defaults to zero.

Methods

impl SignedSqrt
[src]

[src]

Construct a SignedSqrt equal to c √r.

[src]

Equivalent to self.cmp(&Self::from(0)).

[src]

Returns the square of the expression.

[src]

Returns the square of the expression, but with the sign adjusted to match the sign of the original expression.

Trait Implementations

impl Clone for SignedSqrt
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for SignedSqrt
[src]

[src]

Formats the value using the given formatter.

impl Default for SignedSqrt
[src]

[src]

Returns the "default value" for a type. Read more

impl PartialEq for SignedSqrt
[src]

[src]

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

[src]

This method tests for !=.

impl Eq for SignedSqrt
[src]

impl Hash for SignedSqrt
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialOrd for SignedSqrt
[src]

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

impl Ord for SignedSqrt
[src]

[src]

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

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl Mul<SignedSqrt> for SignedSqrt
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl Mul<i32> for SignedSqrt
[src]

The resulting type after applying the * operator.

[src]

Performs the * operation.

impl From<i32> for SignedSqrt
[src]

[src]

Performs the conversion.

impl From<i64> for SignedSqrt
[src]

[src]

Performs the conversion.