Enum roqoqo::CalculatorFloat[][src]

pub enum CalculatorFloat {
    Float(f64),
    Str(String),
}
Expand description

CalculatorFloat is an enum combining Float and String.

Variants

  • Float - f64 value
  • Str - String instance

Variants

Float(f64)

Floating point value

Tuple Fields of Float

0: f64
Str(String)

Symbolic expression in String form

Tuple Fields of Str

0: String

Implementations

Constant zero for CalculatorFloat

Constant one for CalculatorFloat

Constant pi for CalculatorFloat

Constant Euler’s number e for CalculatorFloat

Constant 1/sqrt(2) e for CalculatorFloat

Constant pi / 2 e for CalculatorFloat

Constant pi / 4 e for CalculatorFloat

Constant sqrt(2) e for CalculatorFloat

Return True when CalculatorFloat does not contain symbolic expression.

Return square root of CalculatorFloat.

Return atan2 for CalculatorFloat and generic type T.

Arguments

  • other - Any type T for which CalculatorFloat::From trait is implemented

Return Power for CalculatorFloat and generic type T.

Arguments

  • other - Any type T for which CalculatorFloat::From trait is implemented

Return exponential function exp(x) for CalculatorFloat.

Return sine function sin(x) for CalculatorFloat.

Return cosine function cos(x) for CalculatorFloat.

Return arccosine function acos(x) for CalculatorFloat.

Return absolute value abs(x) for CalculatorFloat.

Return signum value sign(x) for CalculatorFloat.

Return True if self value is close to other value.

Return Some(f64) when CalculatorFloat is a numeric value

Return inverse/reciprocal function (1/x) for CalculatorFloat.

Trait Implementations

Implement + (add) for CalculatorFloat and generic type T.

Arguments

  • other - Any type T for which CalculatorFloat::From trait is implemented

The resulting type after applying the + operator.

Performs the + operation. Read more

Implement + (add) for &CalculatorFloat and generic type T.

Arguments

  • other - Any type T for which CalculatorFloat::From trait is implemented

The resulting type after applying the + operator.

Performs the + operation. Read more

Implement += (add) for CalculatorFloat and generic type T.

Arguments

  • other - Any type T for which CalculatorFloat::From trait is implemented

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

Deserialize this value from the given Serde deserializer. Read more

Implement Display trait for CalculatorFloat.

Allows use of simple text formating

Formats the value using the given formatter. Read more

Implement / (divide) for CalculatorFloat and generic type T.

Arguments

  • other - Any type T for which CalculatorFloat::From trait is implemented

Panics

Panics on division by zero. Division by zero is only detected when other is converted to CalculatorFloat::Float

The resulting type after applying the / operator.

Performs the / operation. Read more

Implement /= (divide) for CalculatorFloat and generic type T.

Arguments

  • other - Any type T for which CalculatorFloat::From trait is implemented

Panics

Panics on division by zero. Division by zero is only detected when other is converted to CalculatorFloat::Float

Performs the /= operation. Read more

Initialize CalculatorFloat from string reference &String.

Returns

  • CalculatorFloat::Float

Performs the conversion.

Initialize CalculatorFloat from str reference &str.

Returns

  • CalculatorFloat::Float

Performs the conversion.

Initialize CalculatorFloat from CalculatorFloat reference &CalculatorFloat.

Returns

  • CalculatorFloat

Performs the conversion.

Initialize CalculatorFloat from f64 reference &.

Returns

  • CalculatorFloat::Float

Performs the conversion.

Initialize CalculatorFloat from i32 reference &.

Returns

  • CalculatorFloat::Float

Performs the conversion.

Initialize CalculatorFloat from usize reference &.

Returns

  • CalculatorFloat::Float

Performs the conversion.

Initialize CalculatorFloat from string value.

Returns

  • CalculatorFloat::Str

Performs the conversion.

Initialize CalculatorFloat from f64 value.

Returns

  • CalculatorFloat::Float

Performs the conversion.

Initialize CalculatorFloat from i32 value.

Returns

  • CalculatorFloat::Float

Performs the conversion.

Initialize CalculatorFloat from usize value.

Returns

  • CalculatorFloat::Float

Performs the conversion.

Implement * (multiply) for CalculatorFloat and generic type T.

Arguments

  • other - Any type T for which CalculatorFloat::From trait is implemented

The resulting type after applying the * operator.

Performs the * operation. Read more

Implement *= (multiply) for CalculatorFloat and generic type T.

Arguments

  • other - Any type T for which CalculatorFloat::From trait is implemented

Performs the *= operation. Read more

Implement minus sign for CalculatorFloat.

The resulting type after applying the - operator.

Performs the unary - operation. Read more

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Implement - (subtract) for CalculatorFloat and generic type T.

Arguments

  • other - Any type T for which CalculatorFloat::From trait is implemented

The resulting type after applying the - operator.

Performs the - operation. Read more

Implement -= (subtract) for CalculatorFloat and generic type T.

Arguments

  • other - Any type T for which CalculatorFloat::From trait is implemented

Performs the -= operation. Read more

Implements summing over an iterator of CalculatorFloat

Arguments

  • iter - Any iterator over CalculatorFloat items

Method which takes an iterator and generates Self from the elements by “summing up” the items. 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

Performs the conversion.

Performs the conversion.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

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)

recently added

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

Converts the given value to a String. 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.