Crates.io | kalk_cli |
lib.rs | kalk_cli |
version | 0.5.4 |
source | src |
created_at | 2020-06-11 22:16:53.817096 |
updated_at | 2021-05-31 12:10:16.579503 |
description | A calculator that supports user-defined functions, variables and units, and can handle fairly ambiguous syntax. |
homepage | |
repository | https://github.com/PaddiM8/kalk |
max_upload_size | |
id | 253029 |
size | 59,608 |
Kalk is a calculator (both program and library) that supports user-defined variables, functions, derivation, and integration. It runs on Windows, macOS, Linux, Android, and in web browsers (with WebAssembly).
Kanban | Website - Try it out here!
f(x, y) = xy
, x = 5
unit m = cm/100
, 2m/50cm
, 50cm to m
f'(2)
, sin'(-pi)
∫(0, pi, sin(x) dx)
or ∫(0, π, sin(x) dx)
2sin50 + 2xy
sqrt
and press tab. It will be turned into √
.sum(start, to, expression)
Eg. sum(1, 3, 2n+1)
is the same as 2*1+1 + 2*2+1 + 2*3+1
= 15
-i file
ans
variable to get the value of the previously calculated expression.There are currently three different libraries related to kalk.
kalk
. This lets you use it in the browser thanks to WebAssembly.@paddim8/kalk
, which let's you use kalk in the browser with a command line-like interface.Pre-compiled binaries for Linux, Windows, and macOS (64-bit) are available in the releases page.
Minimum rust version: v1.36.0. Make sure you have diffutils
gcc
make
and m4
installed. If you use windows: follow the instructions here (don't forget to install mingw-w64-x86_64-rust
in MSYS2).
Run cargo install kalk_cli
kalk_cli
directory.cargo build --release
targets/release
A more complete reference can be found on the website
Defining: name(parameter1, parameter2, ...) = expression
Example: f(x) = 2x+3
Using: name(argument1, argument2)
Example: f(2)
Defining: name = expression
Example: x = 3
Using: name
Example: x
After making changes to the kalk library (in kalk/
), you can easily try them out by going to the root of the project directory, and doing cargo run
. This will start kalk_cli, with the new changes. If you're using Windows, you will need to follow the instructions here, but also make sure to install mingw-w64-x86_64-rust
in MSYS2.
Run:
npm install
npm run dev
- this will automatically re-compile the project when changes are madeRun:
npm install
npx cap sync