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
sqrt(x[,eps])the square root √x [with indicated relative precision result*(1-eps)..result*(1+eps)]. By default precision is 2-64.
cbrt(x[,eps])the cube root ∛x [with indicated relative precision result*(1-eps)..result*(1+eps)]. By default precision is 2-64.
expexponent ex
ln(x[,eps])the logarithm [with indicated precision result-eps..result+eps]. By default precision is 2-64.
log(base,x)the log with the base: logbase(x)
!factorial x!
sin(x[,eps])sine [with indicated precision result-eps..result+eps]. By default precision is 2-64.
cos(x[,eps])cosine [with indicated precision result-eps..result+eps]. By default precision is 2-64.
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!
erf(x)Gauss error function: 2/√π0x(e-t2)ⅆt
num(x)numerator
denom(x)denomirator
round(x)rounding to integer value
round(x,y)rounding in limits [x-y,x+y]
real(x)real part of complex number
imag(x)imagine part of complex number
random(max)random floating number, smaller on absolute value, than max
randomcomplex(x)complex number, smaller in absolute value than abs|x|
randomnormal(average,deviation)random number, with normal distribution

  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