Requires the latest stable Python version.
pip install kalk
After installation run kalk
from your terminal.
In RPN syntax one would first enter the operands and then the operator:
You may also enter the operands and the operator in one line, just use space to separate them:
(tip: the space is not needed when the syntax is not ambiguous.)
Kalk tries to follow Python's syntax. Similar to Python, **
is the power operator and ^
is bitwise XOR:
Kalk ignores ,
(thousands separator) within numbers.
Most of the functions defined in Python's math and statistics modules are supported.
and many more.
You can even do datetime
and timedelta
calculations:
Start a substack (a list) with a [
and end it with a ]
. Some functions require lists as argument. For example to calculate the distance between two points or sum of some numbers:
Handy operators:
-
<>
swaps the place of the last two values in the stack. -
c
clears the stack -
cp
copies the last result to clipboard. -
del
deletes the lastn + 1
values from from the stack withn
being the last value in the stack. -
e
adds Euler's number to the stack -
pi
adds the pi constant to the stack -
pst
pastes the contents of clipboard and evaluates it. -
a
the last answer -
s
prints the stack -
sto
stores the value before the last in storage using the last stack value as the key. -
rcl
recalls the value in storage using the last stack value as the key. -
h
prints a list of all operators. (still needs lots of refinements.) -
?
prints the docstring of the operator given as a string. For example"<>" ?
will print the help string on swap. Note that not all functions have documentation yet. -
ctrl+c
(KeyboardInterrupt) will cancel the current input. -
exit
will quit the program.