use bigdecimal::BigDecimal; use prexel::num::unchecked::UncheckedNum; use prexel::context::DefaultContext; use prexel::evaluator::Evaluator; fn main(){ compute::("100!"); compute::("sqrt(0.7)"); compute::("sin(180)"); compute::("cos(180)"); } fn compute(expr: &str) where T: 'static + UncheckedNum { let context = DefaultContext::::new_unchecked(); let evaluator = Evaluator::with_context(context); match evaluator.eval(expr) { Ok(n) => println!("{} = {}", expr, n), Err(e) => println!("{} = {:?}", expr, e), } }