Similar to UNIX BC (not really).
You can clone normally or with the --recursive
flag to pull submodules.
Build with make
, clean buildspace with make clean
.
Enter the shell using bin/calc
.
Name | Definition | Description |
---|---|---|
-x |
Negation | |
a = b |
Set |
|
a + b |
Addition | |
a - b |
Subtraction | |
a * b |
Multiplication | |
a / b |
Division | |
a ^ b |
Exponentiation | |
a % b |
Modulous |
Name | Definition | Description |
---|---|---|
_ |
default to |
Result of previous expression |
pi |
Constant representing PI | |
e |
Constant representing Euler's number | |
h_deriv |
Infintecimal constant for nderiv
|
|
h_integ |
Infintecimal constant for ninteg
|
Name | Definition | Description |
---|---|---|
abs(x) |
||
sqrt(x) |
||
ln(x) |
||
ln(x, b) |
||
exp(x) |
||
floor(x) |
||
ceil(x) |
||
round(x) |
||
max(a, b) |
Maximum of |
|
min(a, b) |
Minimum of |
|
sin(θ) |
||
cos(θ) |
||
tan(θ) |
||
asin(x) |
||
acos(x) |
||
atan(x) |
||
sinh(x) |
Hyperbolic sine | |
cosh(x) |
Hyperbolic cosine | |
tanh(x) |
Hyperbolic tangent | |
hypot2(a, b) |
||
hypot3(a, b, c) |
||
eq(a, b) |
$\begin{cases}1 &a = b,\ -1 & a \neq b.\end{cases}$ | Equality |
neq(a, b) |
$\begin{cases}1 &a \neq b,\ -1 & a = b.\end{cases}$ | Inverse equality |
lt(a, b) |
$\begin{cases}1 &a < b,\ -1 & a \geq b.\end{cases}$ | Less than |
lte(a, b) |
$\begin{cases}1 &a \leq b,\ -1 & a > b.\end{cases}$ | Less than or equal to |
gt(a, b) |
$\begin{cases}1 &a > b,\ -1 & a \leq b.\end{cases}$ | Greater than |
gte(a, b) |
$\begin{cases}1 &a \geq b,\ -1 & a < b.\end{cases}$ | Greater than or equal to |
ifelse(z, a, b) |
$\begin{cases}a &z \neq 0,\ b & z = 0.\end{cases}$ | If/else ternary |
while(z, f) |
While loop / summation | |
nderiv(f, x, n) |
Derivative at |
|
ninteg(f, x, a, b) |
Definite integral from |