![]()
performances, instructions, examples
(Java applet - Roberto Bigoni - October 2011)
SuperCalculator, unlike an ordinary calculator, can perform calculations on integer, rational, real and complex numbers.
Calculations on integer and rational numbers are always exact.
Integers can be input as binary or hexadecimal: in this case the sequence of digits must end with 'b' or 'h'.
Example: 1011000111011111101b; 12ABCEF01h.
Rational numbers can be input as fractions or repeating decimals.
In this case the repeated digits must be written between square brackets
([...]). Example: 1.2[34].
The decimal separator in real and rational numbers is the period; commas are not allowed: commas act only as separators between the items of a list.
Real numbers can be input in exponential notation. Example: 1.234e-5.
The constants selector allows you to enter directly into the input field the values of the most
common mathematical and physical constants.
Other constants can be stored in memory for further usage.
When calculations generate real numbers, results will be approximated to the number of digit written in the accuracy field (by default 6).
Obviously, if this number is too high, the computing time may become intolerable.
The imaginary unit is written as
I or i: Examples 1+I; 2/3-3/2i; 1.2+3.4i; (2+3I)^2; Sqrt[1-I].
It is possible to make some calculations on matrices and
on vectors. Vectors can be written as lists and the matrices
as lists of lists.
Example: Det[{{1,2,3},{0,1/2,-3},{a,b,0}}].
These objects can also be input using the button matrix in the U.I.
Square matrices (if not singular) and vectors can be used together to obtain solutions of a systems of linear equations.
It is possible to define functions of one or more variables, assigning their expression to arbitrary identifiers.
One can get tables and graphs of real functions.
One can describe and draw simple plane geometric figures.
The operators selector allows you to enter directly into the input field the names of the most
common mathematical functions and operators.
Input and output
In the input field you can write expressions
that must be immediately evaluated. These expressions must be typewritten
using the standard operation signs (see below) and, eventually, parentheses.
After, click the execute button or push the keys Alt-Enter.
You can also write two or more statements separated by a semicolon (;).
Examples: 100!; 100!!; 100!/100!!
f[x]:=x^2-1; Graph[f,-2,2]
c=Circle[0,0,1]; Draw[c].
In the input field you can too declare a function
or assign a constant value. In these cases
execute does'nt generate an explicit result but only stores
the function or the constant.
However, every activation of the execute button writes,
in the output field, the expression in the input field and, below,
the result of the evaluation. These two lines are numbered so you can get them
using the commands In and Out.
To set a new calculation, you can click on the button new input
or the pair of keys Alt+End.
Immediate expressions, declarations of function, assignments of constant can contain the following operation signs:
| sign | operation |
|---|---|
| + | addition |
| - | subtraction |
| * | multiplication(or blank space) |
| / | real division |
| ^ | power |
| ! | factorial |
The following operation signs work only on integer operands.
| sign | operation |
|---|---|
| : | integer division |
| % | remainder of integer division |
| !! | double factorial |
| & | and |
| | | or |
| # | xor |
The following operation signs work on logical operands.
| sign | operation |
|---|---|
| - | not |
| & | and |
| | | or |
| # | xor |
The priority in the evaluation of an expression is given by parentheses, eventually nested.
Expressions may contain the following constants.
(Physical constants have precision limited to their experimental values.)
| constant | name |
|---|---|
| PI | greek pi |
| E | Euler's number |
| PHI | golden number |
| I | imaginary unit |
| TRUE | boolean true value |
| FALSE | boolean false value |
| GAMMA | Euler-Mascheroni constant |
| G | gravitational constant |
| PLANCK | Planck's constant |
| C | speed of light in vacuum |
| AVOG | Avogadro constant |
| R | ideal gas constant |
| BOLTZ | Boltzmann constant |
| ELM | electron rest mass |
| ELC | charge of an electron |
| PRM | proton rest mass |
| PRC | charge of a proton |
| EPS0 | vacuum permittivity |
| MU0 | vacuum permeability |
| RYDB | Rydberg constant, |
| BOHR | Bohr Radius |
| COMPTON | Compton wavelength |
| STEFAN | Stefan-Boltzmann constant |
| SG | Standard acceleration of gravity on the Earth's surface |
| ATM | Standard Atmosphere |
In the input field you can call the following functions that require only one real or complex argument (exceptionally two in powers, radices and logarithms). If the argument is represented by x, it must be real; if the argument is represented by z it can be real or complex. You can obtain tables or graphs only for real function of real variable.
| function | name | example |
|---|---|---|
| Id[z] | identity | Id[PI]; Id[i] |
| Int[x] | integer part | Int[PI] |
| Frac[x] | fractional part | Frac[PI] |
| Abs[z] | absolute value | Abs[1+i] |
| Rec[z] | reciprocal (multiplicative inverse) | Rec[1+i] |
| Arg[z] | argument of a complex | Arg[3+4i] |
| Real[z] | real part of a complex | Real[3+4i] |
| Im[z] | imaginary part of a complex | Im[3+4i] |
| Sqr[z] | square | Sqr[PI]; Sqr[1+i] |
| Cube[z] | cube | Cube[PI]; Cube[1+i] |
| Sqrt[z] | square root | Sqrt[PI]; Sqrt[1+i] |
| Cubert[z] | cube root | Cubert[PI]; Cubert[1+i] |
| Nrt[x,n] | n-th root (n natural ≥ 2) | Nrt[8,3] |
| Fact[z] | factorial | Fact[100]; Fact[PI]; Fact[[1+i] |
| Sin[z] | circular sine | Sin[PI/2]; Sin[ArcSin[2]] |
| Cos[z] | circular cosine | Cos[PI/4]; Cos[ArcCos[2]] |
| Tan[z] | circular tangent | Tan[PI/4]; Tan[1+i] |
| ArcSin[z] | circular arcsine | ArcSin[1/2]; ArcSin[1+i] |
| ArcCos[z] | circular arccosine | ArcCos[1/2]; ArcCos[1+i] |
| ArcTan[z] | circular arctangent | ArcTan[Sqrt[3]]; ArcTan[1+i] |
| Exp[z] | natural exponential | Exp[-2]; Exp[i] |
| Ln[z] | natural logarithm | Ln[Sqr[E]]; Ln[1+i] |
| Log[β,z] | base β logarithm | Log[2,16]; Log[i,Cube[i]] |
| Sinh[z] | hyperbolic sine | Sinh[1]; Sinh[1+i] |
| Cosh[z] | hyperbolic cosine | Cosh[Ln[2]]; Cosh[1+i] |
| Tanh[z] | hyperbolic tangent | Tanh[Ln[2]]; Tanh[1+i] |
| ArcSinh[z] | hyperbolic arcsine | ArcSinh[1]; ArcSinh[1+i] |
| ArcCosh[z] | hyperbolic arccosine | ArcCosh[2]; ArcCosh[1+i] |
| ArcTanh[z] | hyperbolic arctangent | ArcTanh[1]; ArcTanh[1+i] |
| Gamma[z] | Euler's gamma | Gamma[11]==10!; Gamma[1+i] |
| Zeta[x] | Riemann's Zeta | Zeta[-2] |
| EllipticK[x] | complete elliptic integral of the first kind | EllipticK[1/2] |
| EllipticE[x] | complete elliptic integral of the second kind | EllipticE[1/2] |
| Gauss[x] | normalized gaussian (mean 0) | Gauss[1] |
| Erf[x] | Error function | Erf[1] |
These functions can be directly integrated, graphed or tabulated.
Example:
Graph[Sin,0,2PI] Graph[Erf,-2,2,0.1] Table[Sqrt,0,4] List[Cosh,-1,1,0.1] Integrate[Gauss,0,1]
You can also call the following functions with real arguments.
| function | result | example |
|---|---|---|
| Random[x] | pseudorandom number from 0 to x | Random[1] |
| EllipticL[e,a] | calculate the length of the ellipse with eccentricity 0<e<1 and major semiaxis a | EllipticL[1/2,1] |
| LegendreP[n,x] | Legendre function of the first kind | LegendreP[2,1.5]; LegendreP[1/2,1.5] |
| LegendreQ[n,x] | Legendre function of the second kind | LegendreQ[2,1.5]; LegendreQ[1/2,1.5] |
| ChebyshevT[n,x] | Chebyshev's polynomial of the first kind | ChebyshevT[2,1.5] |
| ChebyshevU[n,x] | Chebyshev's polynomial of the second kind | ChebyshevU[2,1.5] |
| Gauss[x,σ] | gaussian with standard deviation σ and mean 0 | Gauss[1,1/2] |
| Gauss[x,σ,μ] | gaussian with standard deviation σ e mean μ | Gauss[2,1,0.5] |
The graphs of these functions cannot be directly produced. To get their graphs, you must declare a function giving it your identifier and writing one or more of the upper names in the second term of the declaration.
Example:
lp2[n]:=LegendreP[n,2]; Table[lp2,0,10,1]
There are also the following operators on real numbers.
| operator | result | example |
|---|---|---|
| DegRad[x] | from decimal degrees to radians | DegRad[60] |
| RadDeg[x] | from radians to decimal degrees | RadDeg[PI/3] |
| DecDms[x] | from decimal degrees to degrees-minutes-seconds | Dms[RadDeg[1]] |
| DmsDec[x] | from sexagesimal to decimal | DmsDec[DecDms[RadDeg[1]]] |
The following operators act on list of real numbers.
| operator | result | example |
|---|---|---|
| Mean[vector] | arithmetic mean | Mean[PI,E,Sqrt[2]] |
| SSDev[vector] | sample standard deviation | SSDev[PI,E,Sqrt[2]] |
| PSDev[vector] | population standard deviation | PSDev[PI,E,Sqrt[2]] |
The list can be represented by a previously declared constant.
Example:
data = 12,14,13,15,11,12,12,14 Mean[data]
The following operator act on a rational number giving its decimal approximation to the given accuracy.
| operator | result | example |
|---|---|---|
| N | from fraction to decimal | N[2/3] |
| N | from repeating to decimal | N[1.2[3]] |
The following operators act on one or more natural numbers.
| operator | result | example |
|---|---|---|
| Gcd[list] | greatest common divisor | Gcd[123456,234567,345678] |
| Lcm[list] | least common multiple | Lcm[123,234,345] |
| PrimeQ[n] | true or false if the argument is prime or not | PrimeQ[1234567] |
| PrimeF[n] | prime factor decomposition | PrimeF[1234567] |
| Prime[n] | n-th prime number | Prime[12] |
| Binomial[n,k] | binomial coefficient | Binomial[100,37]; Binomial[-1/2,3] |
| BinomialD[p,n,k] | binomial distribution | BinomialD[0.3,10,4] |
| Base[n,β] | from base 10 to the base given by the second argument | Base[1234,16] |
| Fibonacci[n] | Fibonacci's sequence n-th number | Fibonacci[1234] |
| Bernoulli[n] | Bernoulli's n-th number | Bernoulli[13] |
| DFact[n] | double factorial | DFact[14] |
| Collatz[n] | Collatz's sequence | Collatz[27] |
| Hn[n] | harmonic: gives the sum of the reciprocal of the natural numbers from 1 to n | Hn[10]-Hn[9] |
Binomial can compute also pairs of real or complex numbers.
The following operators act on one o more previously declared functions. The function identifier or a list of such identifiers must be the first argument. The second and the third argument give the analyzed range.
| operator | result | example |
|---|---|---|
| Derive[f,x0] | approximate calculation of the derivative of a real function at a point in its domain | Derive[Sin,0] |
| DeriveL[f,x0] | approximate calculation of the left derivative of a real function at a point in its domain | DeriveL[Sin,0] |
| DeriveR[f,x0] | approximate calculation of the right derivative of a real function at a point in its domain | DeriveR[Sin,0] |
| Integrate[f,x1,x2] | approximate calculation of the integral of a function in an interval of his domain | Integrate[Sin,0,PI/2] |
| Table[f,x1,x2] | gives the table of a function in the given range | Table[f,0,2PI] |
| Table[f,x1,x2,dx] | gives the table of a function in the given range with given increment | Table[Sin,0,2PI,PI/6] |
| List | same as Table but in text mode | List[Sin,0,2PI,PI/6] |
| Values[f,x1,x2] | gives the set of the values y of a function in the given range | Values[f,0,2PI] |
| Values[f,x1,x2,dx] | gives the set of the values y of a function in the given range with given increment | Values[f,0,2PI,PI/6] |
| Zeroes[f,x1,x2] | gives the approximations of the zeroes in the given range | Zeroes[f,-5,5] |
| Graph[f,x1,x2] | gives the plot of the function in the given range | Graph[f,-5,5] |
| Graph[f,x1,x2,dx] | gives the plot of the function in the given range | Graph[f,-5,5,0.1] |
| Graph[{f,g},x1,x2] | gives the plots of several functions in the given range | Graph[{f,g},-5,5] |
| GraphMax[xmax] | sets the greatest ordinate in the graphs of functions: by default 10 | GraphMax[20] |
| GraphMax | shows the current greatest ordinate in the graphs of functions | GraphMax |
| GraphMin[xmin] | sets the least ordinate in the graphs of functions: by default -10 | GraphMin[20] |
| GraphMin | shows the current least ordinate in the graphs of functions | GraphMin |
| Analysis[f,x1,x2] | finds the approximations to the most important points of a graph of a function in the given range | Analysis[f,-5,5] |
| Histogram[list] | draws the histogram of a list | Histogram[List[Abs,0,10,1]] |
| Histogram[title,list] | draws the histogram of a list with its title | Histogram["Temperatures",{{"Paris",12},{"Berlin",7},{"London",10}}] |
Some input fields allow the setting of the numbers of points to calculate in tables and graphs, the maximum and the minimum values, the colours in the graphs.
The following operators act on one or more numerical vectors.
| operator | result | example |
|---|---|---|
| * | scalar product (dot product) | v1*v2 |
| ** | vector product (cross product) | v1**v2 |
| Norm[v] | the length of the vector | Norm[v] |
| PolarAngle[v] | gets the polar angle of a real two-dimensional vector | PolarAngle[{1/2,Sqrt[3]/2}] |
| UnitVector[v] | the unit vector with the same polar angle | UnitVector[v] |
The vector product can be performed only on two-dimensional o three-dimensional vectors.
Vectors can be multiplied or divided by scalars. If they have the same dimension, they can be added or subtracted.
It is possible to extract a component of a vector.
Examples.
v1={1,2,3}v2={1,-1,3}v1*v2v1**v23*v1-4*v2[m1]v1[0]+v1[1]
The following operators act on square matrices.
| operator | result | example |
|---|---|---|
| Det[m] | square matrix determinant | Det[matr] |
| Transpose[m] | evaluation of the transposed matrix | Transpose[matr] |
| Inverse[m] | evaluation of the inverse matrix | Inverse[matr] |
| Conjugate[m] | evaluation of the conjugate matrix | Conjugate[matr] |
| Adjoint[m] | evaluation of the adjoint matrix | Adjoint[matr] |
| LinearSolve[m,v] | calculate the solution of a system of linear equations | LinearSolve[{{1,2},{0,1}},{3,4}] |
The following operators act on hermitian matrices.
| operator | result | example |
|---|---|---|
| Eigenvalues[h] | Eigenvalues of a hermitian matrix | Eigenvalues[matr] |
| Eigenvectors[h] | Eigenvectors of a hermitian matrix | Eigenvectors[matr] |
Using the standard operation signs one can make additions, multiplications, subtractions, divisions, powers to integer exponent of matrices.
Example.
m1={1,2,3}{2,3,4}{3,4,1}Inverse[m1]m1^2m2={5,2,1}{1,-1,3}{-1/2,0,1}m1*m2m1[0]+m1[1]m1[0][2]^2
The following operators act on the content of lists.
| operator | result | example |
|---|---|---|
| Append[l,o] | given a list identifier l and an item o, puts o at the end of l | Append[l,o] |
| Append[l,l1] | given two list identifiers l and l1, appends to l all the items of l1 | Append[l,l1] |
| Insert[l,o,ix] | given a list identifier l, the item o and an index ix, inserts o in the position ix of l | Insert[l,o,ix] |
| Insert[l,l1,ix] | given two list identifiers l and l1 and an index ix, inserts all the items of l2 in l1 beginning from the position ix | Insert[l,l1,ix] |
| Remove[l,ix] | given a list identifier l and an index ix, removes from l the item at the position ix | Remove[l,ix] |
| Remove[l,ix1,ix2] | given a list identifier l and two indexes ix1 e ix1, removes from l all the items from the position ix1 to the position ix2 | Remove[l,ix1,ix2] |
| Set[l,o,ix] | given a list l, an item o and an index ix, substitutes with o the item at the position ix | Set[l,o,ix] |
| ASort[l] | given a list l containing numeric values or strings, sorts l in ascending order ie from the smallest to the largest | ASort[1,-4,PI,R,11/3,2e-1,2^5] |
| DSort[l] | given a list l containing numeric values or strings, sorts l in descending order ie from largest to smallest | DSort[1,-4,PI,R,11/3,2e-1,2^5] |
| Frequencies[l] | Given a list l containing numeric values, groups the values in ascending order counting how many times they appear in the list. | r[x]:=Int[Random[10]]; Frequencies[Values[r,1,100,1]] |
The following operators generate outputs of financial mathematics.
| operator | result | example |
|---|---|---|
| Percent | given a loan and the interest rate, evaluates the interest | Percent[100000,4.85] |
| Payment | given the loan amount, the annual interest rate, the term and the number of annual payments, evaluates the amount of the periodic payment | Payment[100000,4,10,12] |
| Interest | given the loan amount, the constant periodic payment, the term and the number of annual payments, evaluates the effective annual interest rate | Interest[100000,1250,10,12] |
| Amortization | given the loan amount, the annual interest rate, the term and the number of annual constant payments, prints the amortization table | Amortization[100000,4,10,12] |
The following operators rewrite the input strings and the output values for further calculations.
| operator | result | example |
|---|---|---|
| In | rewrites the n-th input string | In[4] |
| Out | rewrites the n-th output value | Out[4] |
| Clear | cancels a previous assignment | a=1; Clear["a"] |
The following operators give calendarial informations.
| operator | result | example |
|---|---|---|
| Today | today's date | Today |
| Now | the instant time | Now |
| DayOfWeek | the day of the week from year, month, day of the month | DayOfWeek[1900,1,1] |
| Easter | calculates the Easter date of the given year | Easter[2007] |
Trigonometry
| operator | result | example |
|---|---|---|
| Triangle[a,b,c,α,β,γ] | triangle solution | Triangle[1,1,0,PI/6,0,0] |
| DistanceKm[la1,lo1,la2,lo2] | distance between two points on the Earth's surface (kilometers) | DistanceKm[0°,0°,0°,1'] |
| DistanceNm[la1,lo1,la2,lo2] | distance between two points on the Earth's surface (nautical miles) | DistanceNm[44°13',0°,44°14',0°] |
The operator Triangle allows you to solve a triangle given three of its
elements; at least one of them must be a side; angles are input as radians; unknown elements are input as 0.
The last two functions require four arguments expressed by sexagesimal numbers in the following order:
SOUTH latitudes and WEST longitudes require a minus sign.
Distances are calculated as the crow flies along a path on the surface of a theoretical geoid using the Vincenty's method, as applied in a page of Chris Veness.
The following operators allow us to produce and represent some geometric plane figures.
| operator | result | example |
|---|---|---|
| Segment | defines a segment given the coordinates of its ends | s=Segment[-1,-1,1,1] |
| Circle | defines a circle given its center and its radius | c=Circle[0,0,1] |
| Ellipse | defines an ellipse given its eccentricity and its semi-major axis | el=Ellipse[0,0,3,1] |
| Polygon | defines a regular polygon given its centre, its circumscribed radius and its number of sides | hepta=Polygon[0,0,1,7] |
| Polygonal | defines a sequence of consecutive segments given the coordinates of their ends | para=List[Sqr,-1,1]; poly= Polygonal[para]; Draw[poly] |
| Draw | draws one or more figures generated by previous operators | c=Circle[0,0,1]; Draw[c]; para=List[Sqr,-1,1]; poly= Polygonal[para]; Draw[{c,poly}] |
| Translate | translates the figures generated by previous operators | q=Polygon[0,0,1,4]; tq=Translate[q,-1,2]; Draw[tq] |
| Rotate | rotates the figures generated by previous operators | q=Polygon[0,0,1,4]; rq=Rotate[q,30°]; Draw[rq] |
Mathematical expressions
The mathematical expressions must be inputted by typewritten strings, using the keys of a standard keyboard. They can contain numbers given immediately or represented by identifiers of constants, operations signs, built-in functions or user declared functions, parentheses eventually nested and well balanced.
Examples.
PI*8^2(2+3)/4(Sin[PI/3])^2f1[2]+f2[Ln[2]]((10!/9!)+2)/5
Grouping marks
The grouping marks are:
Storage of a constant value
To store a constant value one must write an arbitrary identifier followed
by = and by the value.
Example.
a = 12b = 1/2halfln2 = Ln[2]/2data = {2,2,3,3,4,4,4,4,5,5,5,4,4,3,2,1}matrix1 = {{2,2,3,3},{4,4,4,4},{5,5,5,4},{4,3,2,1}}
(but matrix1 = {2,2,3,3}{4,4,4,4}{5,5,5,4}{4,3,2,1} works fine)Identifiers are case sensitive.
Identifiers can be reassigned.
Declaration of a function
To declare a real function of one or more variables,
one must write an arbitrary identifier followed by brackets enclosing one or more variables.
The brackets must be followed by := (Pascal like) and by
the expression of the function in terms of these variables.
Examples.
f[x] := x^2-1f1[x] := Sin[2x]+2Cos[x]f2[x,y] := Sqrt[x^2+y^2]Parametric functions can be declared as functions of a single variable expressed by a list of two or more expressions. The list must contain only names of functions
Example.
f[x] := {Cos,Sin}g[x] := Sqrt[x^1+1]
f1[x] := {g,Tan}
Declared real functions of one real variable may be analyzed by the following operators.
Table applied to
three arguments: the function identifier and the bounds of the range analyzed.
Zeroes applied to
three arguments: the function identifier and the bounds of the range analyzed.
This operator may be successful only if the function is continue and its signs at the bounds of the
range are opposite.Analysis
applied to three arguments: the function identifier and the bounds of the range analyzed.Graph applied to three arguments: the function identifier
(or the list of identifiers) and the bounds of the range analyzed.
Functions graphs
It is possible to get the graph of a function only if the function has an identifier assigned by the user; that is, you can directly graph only the built-in functions.
For example, if you want the graph of the circular sine, you can write
Graph[Sin,-2PI,2PI], but if you want the graph of another circular sine
you must before declare
a function like this:
sine1[x] := 2Sin[x/2+1]
and, after, use the operator Graph in this way:
Graph[sine1,-2PI,2PI].
It is possible to graph more functions together. For example, you can graph together sine and cosine in
this way
Graph[{Sin,Cos},-2PI,2PI].
It is possible to get the graph of a parametric function of two real variables.
For example, after the declaration of the function
f[x]:={Cos,Sin},
the statement Graph[f,0,2PI]
makes a circle of radius 1.
Example.
Given the functions f1[x] := Cos[x+PI/4] and f2[x] := Cos[x-PI/4]:
we can graph them separately;
Graph[f1,-2PI,2PI]

Graph[f2,-2PI,2PI]

we can graph them together;
Graph[{f1,f2},-2PI,2PI]

we can define a parametric function
f[x] := {f1,f2}
and get its graph
Graph[f,-2PI,2PI]

geometric figures
We can draw some plane geometric figures, like segments, polygons, circles, ellipses, arcs of curves, in a Cartesian plane. In order to do this, we must take the following steps:
we assign an identifier to the result of one of the following operators:
SegmentPolygonalPolygonCircleEllipseTranslateRotateDraw.Examples.
penta=Polygon[0,0,1,5]; Draw[penta]

c=Circle[0,0,1]; square=Polygon[0,0,1,4]; Draw[c,square]

To obtain arcs of curves given by real valued functions, we must take the following steps:
we create a list of points using the operator List; example:
lpara=List[Sqr,-1,1,0.1]
then we create a drawable object using the operator Polygonal; example:
para=Polygonal[lpara]
Now this object can be an argument for the operator Draw.
Example.
lpara=List[Sqr,-1,1,0.1]; para=Polygonal[lpara]; c=Circle[0,0,1]; Draw[para,c]

The description of a drawing can be translated or rotated
tri=Polygon[0,0,1,3]; transl=Translate[tri,2,1]; rot=Rotate[tri,45°]; Draw[tri,transl,rot]

last revision: October 2011