mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-01-08 22:49:07 +01:00
Merge branch 'master' of https://github.com/PaddiM8/kalk
This commit is contained in:
commit
039f79697d
@ -18,6 +18,7 @@ Kalk is a calculator (both program and library) that supports user-defined varia
|
|||||||
* Syntax highlighting
|
* Syntax highlighting
|
||||||
* Special-symbol completion on tab. Eg. write `sqrt` and press tab. It will be turned into `√`.
|
* 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`
|
* 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
|
## Installing
|
||||||
Make sure you have `diffutils` `gcc` `make` and `m4` installed.
|
Make sure you have `diffutils` `gcc` `make` and `m4` installed.
|
||||||
|
@ -18,12 +18,11 @@ f(a, 2)
|
|||||||
* Special-symbol completion on tab. Eg. write `sqrt` and press tab. It will be turned into `√`.
|
* Special-symbol completion on tab. Eg. write `sqrt` and press tab. It will be turned into `√`.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
```
|
```rust
|
||||||
use kalk::parser;
|
use kalk::parser;
|
||||||
|
let mut parser_context = parser::Context::new();
|
||||||
...
|
let precision = 53;
|
||||||
let parser_context = parser::Context::new();
|
assert_eq!(parser::eval(&mut parser_context, "5*3", precision).unwrap().unwrap(), 15);
|
||||||
assert_eq!(parser_context.eval("5*3").unwrap().unwrap(), 15);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Compiling
|
## Compiling
|
||||||
|
Loading…
Reference in New Issue
Block a user