fasteval 0.2.4

Fast evaluation of algebraic expressions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
// usage:  cargo run --release --example ns_btreemap_string

use std::collections::BTreeMap;
fn main() -> Result<(), fasteval::Error> {
    let mut map : BTreeMap<String,f64> = BTreeMap::new();
    map.insert("x".to_string(), 2.0);

    let val = fasteval::ez_eval("x * (x + 1)", &mut map)?;
    assert_eq!(val, 6.0);

    Ok(())
}