This commit is contained in:
PaddiM8 2020-06-12 21:01:12 +02:00
commit 039f79697d
2 changed files with 5 additions and 5 deletions

View File

@ -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.

View File

@ -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