Calc

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

  Accuracy of calculation is defined by interpreter possibilities - 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 last outcome is meant. Monadic 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 smaller x
gcd(x,…,z)the greatest common divisor of integers
lcm(x,…,z)the least common multiple of integers
sqrtsquare root √x
cbrtcube root
expexponent ex
lnthe logarithm natural ln(x)
lgthe logarithm decimal lg(x)
log(base,x)the logarithm with the foundation base: logbase(x)
!factorial x!
sinsine sin(x)
coscosine cos(x)
tgtangent tg(x)
ctgcotangent ctg(x)
arcsinarcsine sin-1(x)
arccosarccosine cos-1(x)
arctgarctangent tg-1(x)
arctg(y,x)arctangent from division tg-1(y/x)
shsine hyperbolic sh(x)
chcosine hyperbolic ch(x)
thtangent hyperbolic th(x)
cthcotangent hyperbolic cth(x)
arsharcsine hyperbolic sh-1(x)
archarccosine hyperbolic ch-1(x)
artharctangent hyperbolic th-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) .
  Supports a writing of numbers with an exponent sign.
  It is authorised to use not-brackets an entry for monadic functions.
  Supports evaluations set by means of brackets.
  For an evaluation it is possible to return last task having pressed the button upwards.
  For an exit it is necessary to press ESC or Ctrl+Q.
  It is possible to start evaluations not using a window.

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