Calc

  The program written in language Lisp2D, calculates forms set by strings. Parses the given expression for calculation and calculates it.
  Calculator start:
  > ./lisp2d calc.lisp2d

  Accuracy of calculation is defined by possibilities of the interpreter - numbers are stored in a mode of fractions.
  Binary functions are supported:
+addition
-subtraction
*multiplication
/division
%remainder of division
^degree
  In the absence of argument of binary function the last result is meant. Unary operation a minus is not supported. It is necessary to write a negative number so:
  -1 → 0-1
  Functions evaluation is supported:
absabsolute value |x|
floorthe integer part of number [x]
floor(x,n)the integer part of division [x/n]
ceilthe minimum integer not the smaller x
gcd(x,…,z)the greatest common diviser of integers
lcm(x,…,z)the least common multiple of integers
sqrtthe square root √x
cbrtcube root
expexponent ex
lnthe log natural ln(x)
lgthe log decimal lg(x)
log(base,x)the log with the basis: logbasis(x)
!factorial x!
sinsine sin(x)
coscosine cos(x)
tantangent tan(x)
cotcotangent cot(x)
arcsinarcsine sin-1(x)
arccosarccosine cos-1(x)
arctanarctangent tan-1(x)
arctan(y,x)arctangent from division tan-1(y/x)
sinhsine hyperbolic sinh(x)
coshcosine hyperbolic cosh(x)
tanhtangent hyperbolic tanh(x)
cthcotangent hyperbolic cth(x)
arsinharcsine hyperbolic sinh-1(x)
arcosharccosine hyperbolic cosh-1(x)
artanharctangent hyperbolic tanh-1(x)
degrees=x*180/π
radians=x/180*π
combin(x,n)=C(x,n)=n!/x!/(n-x)!
combina(x,n)=n!/(n-x)!
multinomial(x,…,z)=(x+…+z)!/x!…/z!

  There is a possibility to use mathematical constants pi and e.
  Function without arguments random returns a random number [0…1).
  Numbers, with the exponent are supported.
  It is authorised to use not parenthesis record for unary functions.
  Supports calculations set by means of brackets.
  For calculation it is possible to return the last task having pressed the button upwards.
  Complex numbers? If you please…
  For an exit it is necessary to press ESC or Ctrl+Q.
  It is possible to start calculations not using a window.

> ./lisp2d calc.lisp2d "9^9" "x" "exp(2)"
387420489 error 7.38905609893