mathhook-core 0.2.0

Core mathematical engine for MathHook - expressions, algebra, and solving
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use mathhook_core::prelude::*;
fn main() {
    println!("\n=== Simple parsing testing ===\n");
    let parser = Parser::new(&ParserConfig::default());
    let expression = parser.parse("sin(π)");
    match expression {
        Ok(e) => {
            let evaluated = e.evaluate().unwrap();
            let value = evaluated.format().unwrap_or(String::from(""));
            println!("The expressions is {}", value);
        }
        Err(e) => {
            println!("Nothing {}", e);
        }
    }
}