calc_engine

Crates.iocalc_engine
lib.rscalc_engine
version0.4.1
sourcesrc
created_at2021-05-07 14:55:43.88254
updated_at2021-05-25 20:02:50.757305
descriptionAn engine / tool that performs calculations.
homepage
repositoryhttps://github.com/tevs-rust-land/rust-calc
max_upload_size
id394275
size19,729
Tev (Tevinthuku)

documentation

README

calc_engine

This Engine transforms a string representation of a Math expression to the actual result of the expression.

I'm using the top-down recursive descent parsing techque. (Input is read from Left -> Right)

How to use.


use calc_engine;

func main() {
    let res = calc_engine::calculate("1 + 1")?;
    let error_margin = f64::EPSILON;
    assert!((result - 2.0).abs() < error_margin);

    let res = calc_engine::calculate("(1 + 1) + 3")?;

}

Still to be done

  • Bug fixes
  • Logarithmic expressions
  • More tests..

Not in any particular order.

Commit count: 67

cargo fmt