+ | addition |
- | subtraction |
* | multiplication |
/ | division |
div | x div y= trunc(x/y) |
mod | remainder, x mod y= x-y*(x div y) |
hypot | hypotenuse, hypot(a,b)=sqrt(a^2+b^2) |
angle | angle(a,b)=atan(a/b) |
rand | random number, 0<=rand<1 |
random | random(n)=trunc(rand*n) |
ctof | converts °Celsius to °Fahrenheit |
ftoc | converts °Fahrenheit to °Celsius |
baseN | next number is in base N, 2<=N<=36, there is no space before N |
dec | base10 |
hex | base16 |
bin | base2 |
oct | base8 |
pi | 3.14159... |
ans | result of previous expression |
powers and logarithms | |
^, ** | power |
# | root, y#x= x^(1/y) |
sqrt | square root, sqrt(x)= 2#x = x^0.5 |
exp | exponential function, exp(x)=e^x, e=2.718... |
ln | natural logarithm, inverse function to exp |
logn | logarithm, logn(n,x)=ln(x)/ln(n) |
log | log(x)=logn(10,x) |
complex numbers | |
real | real part, real(a+bi)=a |
imag | imaginary part, imag(a+bi)=b |
conjg | conjugate, conjg(a+bi)=a-bi |
abs | absolute value, abs x=hypot(real x,imag x) |
arg | phase angle, arg x=angle(imag x,real x) |
sign | sign x=x/abs x |
polar | polar(r,a)=r*cos a + i*r*sin a |
complex | complex(a,b)= a + b i |
conditions and commands | |
== | 1 if operands are equal, 0 otherwise |
!=, <> | not equal |
> | greater |
< | less |
>= | greater or equal |
<= | less or equal |
if(p,a,b) | b if p is zero, or a if p is not zero |
return | stops computation |
return x | stops computation and displays result x |
goto n | jump to a label or to the n-th semicolon, goto0 jumps to the beginning |
gotor n | relative jump, gotor - 1 jumps to the previous command, gotor1 jump to next command, gotor0 will freeze the calculator |
print x,”t” | prints number x and then text t |
swap(a,b) | exchange variables a,b |
rounding | |
round | round to the nearest integer |
int, floor | round down |
ceil | round up |
trunc | integer part |
frac | fractional part, frac x=x-trunc x |
bitwise functions | |
and, & | bitwise and |
or, | | bitwise or |
xor | bitwise exclusive or |
not | the one's complement of the integer part |
bitnand | x bitnand y=not(x and y) |
nand | x nand y=(x==0 or y==0) |
bitnor | x bitnor y=not(x or y) |
nor | x nor y=(x==0 and y==0) |
bitimp | x bitimp y=y or not x |
imp, -> | x imp y=(x==0 or y<>0) |
biteqv | x biteqv y= not(x xor y) |
eqv | x eqv y=((x==0)==(y==0)) |
lsh, << | shift left, x<<y=x*2^y |
rsh, >> | shift right, x>>y=x<<-y |
rshi, >>> | x>>>y=trunc(x>>y) |
integer functions | |
!, fact | factorial, n!=fact(n)= productfor(i,1,n,i) |
!!, ffact | n!!=ffact(n)= productfor(i,0,n/2-1,n-2*i) |
combin, nCr | combination, n nCr k = n!/(n-k)!/k! |
permut, nPr | variation, n nPr k = n!/(n-k)! |
gcd | the greatest common divisor |
lcm | the least common multiple, lcm(a,b)=a*b/gcd(a,b) |
divisor | the least prime divisor of an operand |
prime | prime that is greater then an operand |
isprime | isprime(n)=(divisor(n)==n) |
fibon | Fibonacci, fibon(n)=fibon(n-1)+fibon(n-2) |
angle conversions | |
radtodeg | converts radians to degrees, radtodeg x= x/pi*180 |
degtorad | converts degrees to radians |
radtograd | converts radians to gradients, radtograd x= x/pi*200 |
gradtorad | converts gradients to radians |
degtograd | converts degrees to gradients, degtograd x= x*10/9 |
gradtodeg | converts gradients to degrees |
deg , ° | converts degrees to the current units |
rad | converts radians to the current units |
grad | converts gradients to the current units |
todeg | converts the current units to degrees |
torad | converts the current units to radians |
tograd | converts the current units to gradients |
dms | converts degrees, minutes and seconds to degrees, the integer part is degrees, two digits after a decimal point are minutes, next two digits are seconds, next digits are tenth of a second, hundredth of a second, ... |
todms | inverse function to dms |
trigonometric functions | |
sin | sine, (opposite side / hypotenuse) |
cos | cosine, (adjacent side / hypotenuse) |
tan, tg | tangent, (opposite side / adjacent side) |
cosec, csc | cosecant, (hypotenuse / opposite side) |
sec | secant, (hypotenuse / adjacent side) |
cot, cotg | cotangent, (adjacent side / opposite side) |
inverse trigonometric functions | |
asin, arcsin | asin(x)=-ln(x i+sqrt(1-x^2)) i |
acos, arccos | acos(x)=-ln(x+sqrt(1-x^2) i) i |
atan, atg, arctan, arctg | atan(x)=(ln(1+x i)-ln(1-x i))/2i |
acsc | acsc(x)=asin(1/x) |
asec | asec(x)=acos(1/x) |
acot, acotg, arccot, arccotg | acot(x)=atan(1/x) |
hyperbolic functions | |
sinh | sinh(x)=(exp(x)-exp(-x))/2 |
cosh | cosh(x)=(exp(x)+exp(-x))/2 |
tanh, tgh | tanh(x)=sinh(x)/cosh(x) |
csch | csch(x)=1/sinh(x) |
sech | sech(x)=1/cosh(x) |
coth, cotgh | coth(x)=cosh(x)/sinh(x) |
inverse hyperbolic functions | |
asinh, argsinh | asinh(x)=ln(x+sqrt(x^2+1)) |
acosh, argcosh | acosh(x)=ln(x+sqrt(x+1)*sqrt(x-1)) |
atanh, atgh, argtanh, argtgh | atanh(x)=(ln(1+x)-ln(1-x))/2 |
acsch | acsch(x)=asinh(1/x) |
asech | asech(x)=acosh(1/x) |
acoth, acotgh, argcoth, argcotgh | acoth(x)=atanh(1/x) |
matrices | |
+, - , ==, <>, and, or, xor, lsh, rsh, real, imag, conjg, round, trunc, floor, ceil, frac | |
width | number of columns |
height | number of rows |
matrix(r,c) | zero matrix which has r rows and c columns |
count | count A= width A * height A |
, | concatenation alongside, operands must have the same number of rows |
\ | concatenation below, operands must have the same number of columns |
* | matrix multiplication or scalar multiplication |
vert | vector product, A vert B=(A[1]*B[2]-A[2]*B[1], A[2]*B[0]-A[0]*B[2], A[0]*B[1]-A[1]*B[0]) |
/ | A/B= A*invert B |
^ | A^n= productfor(i,1,n,A); A^(-n)=1/(A^n) |
invert | inverted matrix, invert A= 1/A= A^(-1) |
det | determinant |
rank | count of linearly independend rows |
transp, ‘ | diagonal symmetry |
elim | elimination method that makes elementary transformations with rows |
solve | simultaneous linear equations, every row represents one equation, last column is the right side of equations, (number of columns) = 1 + (number of variables), number of rows is not restricted, but it is usually same as number of variables |
abs | vector length, matrix norm, abs A= sqrt sumq A |
angle | angle between two vectors, angle(A,B)=acos(A*B/abs(A)/abs(B)) |
polynom | polynom(x,A)=sumfor(i,0,count A-1, A[i]*x^i) |
sort | sort items from lesser to greater |
sortd | sort items from greater to lesser |
reverse | change order of items from last to the first |
loops | |
for(x,a,b,f(x)) | values from a to b are assigned to variable x and command f is executed, result is 0, f can modify variables, f can contain command if, return, ... |
foreach(x,A,f(x)) | this function is similar to for except that every element of matrix A is assigned to variable x |
sumfor(x,a,b,f(x)) | S=0; for(x,a,b,S=S+f(x)); S |
productfor(x,a,b,f(x)) | S=1; for(x,a,b,S=S*f(x)); S |
listfor(x,a,b,f(x)) | row vector which contains values f(x) where x is from a to b. If f(x) returns column vectors, then listfor returns matrix. If a>b then listfor returns 0. |
rowsfor(x,a,b,f(x)) | column vector which contains values f(x) where x is from a to b. If f(x) returns row vectors, then rowsfor returns matrix. If a>b then rowsfor returns 0. |
minfor(x,a,b,f(x)) | min(listfor(x,a,b,f(x))) |
maxfor(x,a,b,f(x)) | max(listfor(x,a,b,f(x))) |
filterfor(x,a,b,f(x)) | row vector of x values from a to b for which f(x) is nonzero |
sumforeach, productforeach, listforeach, rowsforeach, minforeach, maxforeach, filterforeach - these functions are similar to the foregoing functions, but the x values are taken from matrix A | |
integral(x,a,b,n,f(x)) | integral from a to b from function f(x), n is precision (number of correct decimal digits, other digits are wrong !), if n>=100 then n is duration in milliseconds |
statistical functions | |
min | minimal value |
max | maximal value |
med | median, middle value |
mode | most frequent value |
sum | total sum |
sumq | sum of squared values |
product | product |
ave, mean | mean, ave=sum/count |
aveq, meanq | mean of squared values, aveq=sumq/count |
geom | geometric mean, geom=count#product |
agm | arithmetic–geometric mean |
harmon | harmonic mean, harmon(A)=count(A)/sumforeach(x,A,1/x) |
var | variance, var=(sumq-sum^2/count)/(count-1) |
vara | variance of population, vara=aveq-ave^2 |
stdev | standard deviation, stdev=sqrt(var) |
stdeva | standard deviation of population, stdeva=sqrt(vara) |
linear regression | |
Points in a plane are represented by a matrix which has two columns. The first column contains x coordinates, the second column contains y coordinates. Functions lra and lrb get coeficients of line y=a+b*x which goes through the points. If all points are exactly on the line, then function lrr returns 1 or -1. | |
lra | lra=(sumy-b*sumx)/n |
lrb | lrb=(n*sumxy-sumx*sumy)/(n*sumxq-sumx^2) |
lrr | correlation coeficient, lrr=(n*sumxy-sumx*sumy)/sqrt((n*sumxq-sumx^2)*(n*sumyq-sumy^2)) |
lrx | lrx(D,y)=(y-lra D)/lrb D |
lry | lry(D,x)=lra D + x*lrb D |
sumx | sumx D= sum D[][0] |
sumy | sumy D= sum D[][1] |
sumxy | sumxy D= sumfor(i,0, height data-1, data[i][0]*data[i][1]) |
sumxq, sumyq, avex, avey, avexq, aveyq, varx, vary, varxa, varya, stdevx, stdevy, stdevxa, stdevya |