[][src]Module rsc::computer

This module is for taking instructions generated by the parser (an AST) and producing real numbers.

Custom Numbers

The only type supported out of the box is the f64.

If you are implementing a number type that is not included by default, you will need to implement numerous traits for that type. Here are the traits required: Num + Clone + PartialOrd + Neg<Output = T> + Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Div<Output = T>

Structs

Computer

A Computer object calculates expressions and has variables.

Enums

ComputeError

Errors generated when computing for numbers.

Traits

Num

Because Rust does not have a generic number trait, any other types of numbers than the support out of the box f64 will need to have this trait implemented on it.