diff --git a/README.md b/README.md index 74808dd..64a331c 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Kalk is a calculator (both program and library) that supports user-defined varia * Syntax highlighting * Special-symbol completion on tab. Eg. write `sqrt` and press tab. It will be turned into `√`. * Sum function: `sum(start, to, expression)` Eg. `sum(1, 3, 2n+1)` is the same as `2*1+1 + 2*2+1 + 2*3+1` = `15` +* Load a file including predefined functions and constants. For example, if you're going to use Kalk for physics, you load up your file with physics functions/constants when starting Kalk. `-i file` ## Installing Make sure you have `diffutils` `gcc` `make` and `m4` installed. diff --git a/kalk/README.md b/kalk/README.md index 3878294..a238b55 100644 --- a/kalk/README.md +++ b/kalk/README.md @@ -18,12 +18,11 @@ f(a, 2) * Special-symbol completion on tab. Eg. write `sqrt` and press tab. It will be turned into `√`. ## Usage -``` +```rust use kalk::parser; - -... -let parser_context = parser::Context::new(); -assert_eq!(parser_context.eval("5*3").unwrap().unwrap(), 15); +let mut parser_context = parser::Context::new(); +let precision = 53; +assert_eq!(parser::eval(&mut parser_context, "5*3", precision).unwrap().unwrap(), 15); ``` ## Compiling