modulepackage
0.0.0-20210318013304-deabb0be5ba6
Repository: https://github.com/pointlander/calc.git
Documentation: pkg.go.dev
# README
calc
A command line calculator.
Installation
git clone https://github.com/pointlander/calc.git
cd calc
go install
Usage
calc
Language
e <- sp e1 !.
e1 <- e2 ( add e2
/ minus e2
)*
e2 <- e3 ( multiply e3
/ divide e3
/ modulus e3
)*
e3 <- e4 ( exponentiation e4
)*
e4 <- minus value
/ value
value <- matrix
/ imaginary
/ number
/ exp1
/ exp2
/ natural
/ pi
/ prec
/ simplify
/ derivative
/ log
/ sqrt
/ cos
/ sin
/ tan
/ variable
/ sub
variable <- [A-Za-z]+ sp
matrix <- '[' sp (e1 / row)+ ']' sp
imaginary <- < [-]? [0-9]+ ([.] [0-9]*)? > 'i' sp
number <- < [-]? [0-9]+ ([.] [0-9]*)? > sp
exp1 <- 'exp' open e1 close
exp2 <- 'e^' value
natural <- 'e' sp
pi <- 'pi' sp
prec <- 'prec' open e1 close
simplify <- 'simplify' open e1 close
derivative <- 'derivative' open e1 close
log <- 'log' open e1 close
sqrt <- 'sqrt' open e1 close
cos <- 'cos' open e1 close
sin <- 'sin' open e1 close
tan <- 'tan' open e1 close
sub <- open e1 close
add <- '+' sp
minus <- '-' sp
multiply <- '*' sp
divide <- '/' sp
modulus <- '%' sp
exponentiation <- '^' sp
open <- '(' sp
close <- ')' sp
sp <- ( ' ' / '\t' )*
row <- ';' sp
# Packages
No description provided by the author
# Constants
OperationAdd adds two numbers.
OperationCosine computes the cosine of a number.
OperationDivide divides two numbers.
OperationExponentiation raises a number to a number.
OperationImaginary is an imaginary number.
OperationModulus computes the modulus of two numbers.
OperationMultiply multiplies two numbers.
OperationNatural is the constant e.
OperationNaturalExponentiation raises the natural number to a power.
OperationNaturalLogarithm os the natural logarithm.
OperationNegate changes the sign of a number.
OperationNoop is a noop.
OperationNotation is E notation operation.
OperationNumber is a real number.
OperationPI is the constant pi.
OperationSine computes the sine of a number.
OperationSquareRoot computes the square root of a number.
OperationSubtract subtracts two numbers.
OperationTangent computes the tangent of a number.
OperationVariable is a variable.
ValueTypeExpression is an expression value type.
ValueTypeMatrix is a matrix value type.
# Structs
No description provided by the author
Node is a node in an expression binary tree.
Value is a value.