A calculator/expression evaluator written in rust that supports variables and functions.
Kalk is a calculator (both program and library) that supports user-defined variables, functions, and units (experimental, limited). It runs on Windows, macOS, Linux, Android, and in web browsers (with WebAssembly).
f(x, y) = xy,
x = 5
unit m = cm/100,
50cm to m
2sin50 + 2xy
sqrtand 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=
ansvariable to get the value of the previously calculated expression.
kalk. This lets you use it in the browser, thanks to WebAssembly. * @paddim8/kalk-component: A web component that acts as a frontend to
@paddim8/kalk, which lets 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
m4installed. If you use windows: follow the instructions here (don't forget to install
cargo install kalk_cli
cargo build --release
A more complete reference can be found on the website
Defining: name(parameter1, parameter2, ...) = expression
f(x) = 2x+3
Using: name(argument1, argument2)
Defining: name = expression
x = 3
Note: You only need to define the relationship between two units once. You will be able to convert between both of them. Defining:
unitname = expression
unit deg = (rad*180)/π
Using: Use them freely in expressions.
2 m to cm