summaryrefslogtreecommitdiff
path: root/math/calc/pkg-descr
blob: 3944e2f9ea8884b53a561e3ee99f7b0b62c08963 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Calc is an interactive calculator which provides for easy large
numeric calculations, but which also can be easily programmed for
difficult or long calculations.  It can accept a command line
argument, in which case it executes that single command and exits.
Otherwise, it enters interactive mode.  In this mode, it accepts
commands one at a time, processes them, and displays the answers.  In
the simplest case, commands are simply expressions which are
evaluated.  For example, the following line can be input:

        3 * (4 + 1)

and the calculator will print 15.

The special '.' symbol (called dot), represents the result of the last
command expression, if any.  This is of great use when a series of
partial results are calculated, or when the output mode is changed and
the last result needs to be redisplayed.  For example, the above
result can be doubled by typing:

        . * 2

and the calculator will print 30.

For more complex calculations, variables can be used to save the
intermediate results.  For example, the result of adding 7 to the
previous result can be saved by typing:

        old = . + 7

Functions can be used in expressions.  There are a great number of
pre-defined functions.  For example, the following will calculate the
factorial of the value of 'old':

        fact(old)

and the calculator prints 13763753091226345046315979581580902400000000.
Notice that numbers can be very large. (There is a practical limit
of several thousand digits before calculations become too slow.)

The calculator can calculate transcendental functions, and accept and
display numbers in real or exponential format. For example, typing:

        config("display", 50)
        epsilon(1e-50)
        sin(1)

prints "~.84147098480789650665250232163029899962256306079837".

The calculator also knows about complex numbers, so that typing:

        (2+3i) * (4-3i)

prints "17+6i".