This is code accompanying the series of articles Building Zerocalc.
Zerocalc has commandline interface and a UI. Both support the follwing features:
** Numbers **
Numbers can have spaces and underscores:
1 000_000
3.14 15
. 123
Floats can use scientific notation:
2e-2 == 0.02
** Operators **
+
addition,
-
subtraction,
*
multiplication,
/
division,
^
power,
%
modulo
** Constants **
e
, pi
** Functions **
- abs(x) - absolute value of x
- sin(x), cos(x), tan(x) - x in radians
- asin(x), acos(x), atan(x) - x in radians
- ln(x), log10(x) - natural logarithm, common logarith
- log(x, y) - base y logarithm
- sqrt(x) - square root
- root(x, y) - y'th root of x
** Variables **
x = (1 + 2)
y = x / 3