Enum ripin::evaluate::FloatEvaluator
[−]
[src]
pub enum FloatEvaluator<T: Float> { Add, Sub, Mul, Div, Rem, Neg, Sqrt, Pow, Log2, Exp, Swap, Zero, One, Round, // some variants omitted }
Basic Float Evaluator for any type that implement the Float
Trait.
Variants
Add
"+"
will pop 2
operands and push 1
.
Sub
"-"
will pop 2
operands and push 1
.
Mul
"*"
will pop 2
operands and push 1
.
Div
"/"
will pop 2
operands and push 1
.
Rem
"%"
will pop 2
operands and push 1
.
Neg
"neg"
will pop 1
operand and push 1
.
Sqrt
"sqrt"
will pop 1
operand and push 1
.
Pow
"pow"
will pop 2
operands and push 1
.
Log2
"log2"
will pop 1
operand and push 1
.
Exp
"exp"
will pop 1
operand and push 1
.
Swap
"swap"
will pop 2
operands and push 2
.
Zero
"zero"
will pop 0
operand and push 1
.
One
"zero"
will pop 0
operand and push 1
.
Round
"round"
will pop 1
operand and push 1
.
Trait Implementations
impl<T: Debug + Float> Debug for FloatEvaluator<T>
[src]
impl<T: Copy + Float> Copy for FloatEvaluator<T>
[src]
impl<T: Clone + Float> Clone for FloatEvaluator<T>
[src]
fn clone(&self) -> FloatEvaluator<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Float> Evaluate<T> for FloatEvaluator<T>
[src]
type Err = FloatEvaluateErr
The type returned in the event of an evaluation error.
fn operands_needed(&self) -> usize
Returns the number of operand this Evaluator
needs and will pop()
from the stack
. Read more
fn operands_generated(&self) -> usize
Returns the number of operand this Evaluator
will generate and will push()
in the stack
. Read more
fn evaluate(self, stack: &mut Stack<T>) -> Result<(), Self::Err>
Execute the evaluation with the given stack
, returns the Evaluation
error if something goes wrong. Read more
impl<'a, T: Float> TryFromRef<&'a str> for FloatEvaluator<T>
[src]
type Err = FloatErr<'a>
The type returned in the event of a conversion error.
fn try_from_ref(expr: &&'a str) -> Result<Self, Self::Err>
Performs the conversion.