  calc User's Manual
  Eduardo M Kalinowski, ekalin@iname.com
  Version 2.0.0
  ____________________________________________________________

  Table of Contents




























































  1. Introduction and Disclaimer

  2. Using calc

     2.1 Reverse Polish Notation
     2.2 Complex numbers
        2.2.1 Polar form
     2.3 Inf and NaN's
     2.4 Entering commands
     2.5 Command Line Options
     2.6 Getting Help

  3. Using Readline

     3.1 Readline essentials
     3.2 Killing text
     3.3 Numeric Arguments
     3.4 The history
     3.5 Other commands

  4. Arithmetic commands

     4.1 The
     4.2 The
     4.3 The
     4.4 The
     4.5 The
     4.6 The
     4.7 The
     4.8 The
     4.9 The
     4.10 The
     4.11 The
     4.12 The
     4.13 The
     4.14 The
     4.15 The
     4.16 The
     4.17 The

  5. Exponential and Logarithmic Commands

     5.1 The
     5.2 The
     5.3 The
     5.4 The
     5.5 The
     5.6 The
     5.7 The
     5.8 The
     5.9 The
     5.10 The

  6. Trigonometric commands

     6.1 The
     6.2 The
     6.3 The
     6.4 The
     6.5 The
     6.6 The
     6.7 The
     6.8 The
     6.9 The
     6.10 The

  7. Hyperbolic commands

     7.1 The
     7.2 The
     7.3 The
     7.4 The
     7.5 The
     7.6 The

  8. Stack manipulation commands

     8.1 The
     8.2 The
     8.3 The
     8.4 The
     8.5 The
     8.6 The
     8.7 The
     8.8 The
     8.9 The
     8.10 The
     8.11 The
     8.12 The
     8.13 The
     8.14 The
     8.15 The

  9. Miscellaneous commands

     9.1 The
     9.2 The
     9.3 The
     9.4 The
     9.5 The
     9.6 The
     9.7 The
     9.8 The
     9.9 The
     9.10 The
     9.11 The
     9.12 The
     9.13 The
     9.14 The
     9.15 The
     9.16 The

  10. Time and date commands

     10.1 The
     10.2 The
     10.3 The
     10.4 The
     10.5 The
     10.6 The
     10.7 The
     10.8 The
     10.9 The
     10.10 The
     10.11 The

  11. Complex number commands

     11.1 The
     11.2 The
     11.3 The
     11.4 The
     11.5 The
     11.6 The
     11.7 The
     11.8 The

  12. Relational commands

     12.1 The
     12.2 The
     12.3 The
     12.4 The
     12.5 The
     12.6 The
     12.7 The
     12.8 The
     12.9 The
     12.10 The

  13. String commands

     13.1 The
     13.2 The
     13.3 The
     13.4 The
     13.5 The
     13.6 The
     13.7 The
     13.8 The
     13.9 The
     13.10 The
     13.11 The
     13.12 The
     13.13 The

  14. Using the memory

     14.1 Listing and erasing the memory
     14.2 Saving objects to the disk

  15. Memory commands

     15.1 The
     15.2 The
     15.3 The
     15.4 The
     15.5 The
     15.6 The
     15.7 The
     15.8 The
     15.9 The
     15.10 The

  16. Customization

     16.1 The
     16.2 Options that can be set
        16.2.1 Angle mode
        16.2.2 Coordinate mode
        16.2.3 Number display format and precision
        16.2.4 Prompt
        16.2.5 Number of lines to display
     16.3 The configuration file


  ______________________________________________________________________

  1.  Introduction and Disclaimer

  This document described calc version 2.0.0, a full featured scientific
  calculator using Reverse Polish Notation (see section ``Reverse Polish
  Notation''). It supports a wide range of functions, and a built-in
  help system (see section ``Getting Help'').

  As of version 2.0.0, only real numbers are supported. Subsequent
  versions will include support for complex numbers and perhaps other
  data types.

  The calc program tries to work as closely as possible to an HP48
  calculator. If you are used to that calculator, you should have no
  problem using calc.

  For installation instructions, see the file INSTALL.

  You may distribute calc freely, but only in its whole, unmodified
  form. You are allowed to make modifications to this program, but only
  for your personal use; you may not redistribute your modified version.
  For details, see the file COPYING.

  The above conditions do not necessarily apply to the GNU Readline
  Library, used by this program. See the file COPYING.lib to see the
  conditions for the distribution of the Readline library.

  This program is provided in the hope it will be useful, but without
  any warranty. Use it at your own risk.


  2.  Using calc

  To run calc, just enter calc at your shell prompt. You'll see the >
  prompt. You can now enter commands. For example, enter 2 3 +. You
  should see the result (5) followed by another prompt. The entire
  session would look like this:



       $ calc
       calc v2.0.0, Copyright (C) 1999 Eduardo M Kalinowski (ekalin@iname.com)
       This program comes with ABSOLUTELY NO WARRANTY. See COPYING file for details.

       > 2 3 +
       [  1]                  5

       >




  The calculator is ready to receive more commands. For example, let us
  divide the result of the previous calculation by 3. Just enter 3 /.
  The result is shown.

  When you are done, enter q or quit to quit.




  2.1.  Reverse Polish Notation

  calc uses Reverse Polish Notation (or RPN for short). Although strange
  at first, RPN is much easier to use than the normal notation,
  especially for long calculations.

  In RPN, the operators (ie, +, -, sin, etc) come after the operands.
  So, the expressin ``(5 + 2) / 3'' would be written as ``5 2 + 3 /''.
  The order of evaluation is always from left to right, and parenthesis
  are never necessary.

  The results of the calculations are put in a stack. Its operation is
  like a pile of plates. The piles are put at the top of the pile, and
  taken from the top of the pile. Thus, the first plat put on the pile
  is the last one to be taken.

  In RPN calculators, the stack is upside down, that is, the numbers are
  put at the bottom (and so taken from the botton.) To put a number in
  calc's stack, just enter the number at the > prompt.

  By default, only the first four levels of the stack are shown (this
  can be changed, see the section ``Command-Line Arguments''.) If you
  want to see the more of stack, use the = command (see ``The =
  command''.

  By default, the stack can hold up to 25 items. If you think you need
  more (which is unlikely) you can change this limit. See the INSTALL
  file for instructions.



  2.2.  Complex numbers

  Starting at version 2.0.0, there is support for complex numbers. To
  enter a complex number, use the following syntax:



       > (x, y)




  Where x is the real part and y is the imaginary part. You may omit the
  space or the comma separing the real and imaginary parts, but not
  both.

  Executing operations on complex numbers is the same as in real
  numbers. Just put the operands in the stack and enter the command,
  such as + or cosh.



  2.2.1.  Polar form

  Complex numbers can also be entered and/or displayed in polar form.
  To enter a number in polar form, do like this:



       > (r, <theta)




  Where r is the magnitude and theta the angle. You may omit the space
  and the comma if you wish.

  When complex numbers are displayed in polar form, they are shown with
  a similar syntax. Too configure calc to display numbers in polar form,
  see section ``Coordinate Mode''.

  The current angle mode (degrees or radians) is taken in consideration
  when entering and displaying complex numbers. See section ``Angle
  Mode'' for information on changing the angle mode.




  2.3.  Inf and NaN's

  Provided your system supports it, calc has support for non-stop
  calculations. This means you'll never get an error while you're doing
  your calculations, except if you do not enter enough arguments or if
  you mistake the argument type. But you'll not get an error for
  dividing 1 by 0, or even 0 by 0.

  To achieve this, two concepts are important: Inf and NaN. You'll get
  Inf as a result whenever you run a function which an argument that
  would result in a very large result, such as 1e300 * 1e300, or 2
  divided by 0. You can read "Inf" as infinity, and that's what it
  means. Its complement is -Inf, which is negative infinity.

  The other concept is NaN (short for Not-a-number). You get this result
  when the result of a function you called is undefined, such as 0/0,
  Inf-Inf, and so on.

  If you want to get one of this values in the stack, you can just use
  the commands inf, -inf and nan.




  2.4.  Entering commands

  The most basic way to enter commands (and seldom used) is to enter one
  command at a time, each on its only line. However, it is easier to
  enter more than one command in each line. Separate each command with a
  space. Numbers should also be separated from commands and from other
  numbers with spaces.

  If you just press <ENTER> without entering any command, the stack will
  be shown.

  Case is irrelevant when entering commands, so ``dup'' is the same as
  ``DUP''.

  This program uses the GNU Readline Library. This allows you to edit
  the commands you've entered as if you were using a text editor. For
  more information, see ``Using Readline''.



  2.5.  Command Line Options

  calc accepts some command line options. The invocation form of calc
  is:



            calc [-d n] [-b] [-s] [-m] [--] [commands]
       or:  calc --help | --version




  The -d option must be followed by a numeric argument. It specified how
  many lines of the stack will be shown by default. If this option is
  not present, four is assumed. To make the whole stack be displayed all
  times, use -1 as argument. Note that if you use -d 0 no stack will be
  shown.

  If there is a number in the command line specifying the number of
  elements to display, it overrides the number saved in the
  configuration file (see ``The configuration file'').

  The -s option tells calc not to load the stack from its configuration
  file (see ``The configuration file'').

  The -m option tells calc not to load the memory from its configuration
  file (see ``The configuration file'').

  The -b run calc in batch mode, that is, the calculator immediately
  exits after processing the commands given in the command line. If no
  commands are given in the command line, it just prints the copyright
  message and exits.

  The --help option displays a help message with the command line
  options and then exits successfully. The --version option displays
  version information and exits successfully.

  You can enter commands on the command line to be executed as if they
  were entered at the prompt. However, if you try to enter a negative
  number or the - command, it will be mistakenly taken as an option, and
  you'll get undesirable results. To avoid this problem, put -- before
  the commands. This tell calc to process all arguments after it as
  commands.



  2.6.  Getting Help

  At any time, you can enter the help command at the prompt to get help.
  Without arguments, it displays a list of commands. To get help on a
  specific command, enter help followed by the command's name, for
  example help sin.





  3.  Using Readline

  This command uses the GNU Readline Library. This allows you to edit
  the commands you've entered as if you were using a text editor. You
  can move the cursor, insert or delete text, and much more. If you are
  familiar with Readline, you probably want to skip this section. This
  is because the Readline library provides a consistent user interface
  between all programs that use it.



  3.1.  Readline essentials

  You can enter characters as usual. Just type them, and they'll appear
  on the screen. Use the Backspace key (or the Delete key, if your
  keyboard doesn't have a Backspace key) to delete the last character.
  To move the cursor, use the left and right arrow keys. If your
  keyboard doesn't have arrow keys, the keys Control-b and Control-f
  will move the cursor to the left and right, respectively. To move
  forward or backward a word, use the Alt-b and Alt-f keys. The "Alt"
  key may be labelled "Edit" on some keyboards. If you don't have an Alt
  or Edit key, press ESC, release it and then press b (or f).  This
  combination works for all commands that use the Alt key.
  To move to the beginning of the line, use Control-a. To move to the
  end of the line, use Control-e.

  Another useful command is Control-_ (underscore). It undoes the last
  action. So, if you make a mistake, just press Control-_ to undo it.



  3.2.  Killing text

  Killing means deleting text from a line, but saving it somewhere it
  can be later brought again. The operation of bringing back killed text
  is called "yanking".

  Whenever you use one of the kill commands, the text is saved in the
  "kill ring". Any number of consecutive kills saves the text together,
  so when you yank it you'll get it all back. The kill-ring is not line-
  specific, you may yank text from a previous line.

  The most frequently used kill and yank commands are:



     Control-k
        Kill text from the cursor position to the end of the line.


     Alt-d
        Kill from the cursor postion to the end of the current word, or,
        if between words, to the end of the next word.


     Alt-Backspace (or Alt-Del in some computers)
        Kill from the cursor postion to the start of the current word,
        or, if between words, to the start of the previous word.


     Control-y
        Yank the most recently killed text back at the cursor position.


     Alt-y
        Rotate the kill-ring. This command can only be used if the
        previous command was Control-y or Alt-y. This replaces the last
        yanked text with the text that was killed before it.




  3.3.  Numeric Arguments

  Most Readline commands support numeric arguments. For example, if you
  give the argument 5 to the command Control-f (go forward a character)
  it goes five characters forward.

  To enter an argument to a command, press Alt and the argument digit
  simultaneously. For example, to give the Control-f command an argument
  of 10, press Alt-1 0 Control-f. Arguments can also be negative, if you
  press Alt-- (hyphen) as the first argument digit. If you just specify
  "-" as argument, it is equivalent to -1.






  3.4.  The history

  All commands you type are saved in the history. To cycle through the
  commands in the history in order, use the up and down arrow keys or
  the Control-p and Control-n keys.

  To search the history for a specific entry, press Control-R then enter
  part of the command. As your entry matches the history lines, they are
  shown. When you've found what you wanted, press Enter to execute the
  command or any other key to execute the action bound to that key. To
  finish a search, use Control-g.



  3.5.  Other commands

  In calc use the Tab key to insert the element in level one at the
  command line. With an argument, inserts the number at the given level.

  There are also many other commands for Readline, and it can also be
  customized for your personal taste. For more information, see the
  Readline manual.



  4.  Arithmetic commands

  4.1.  The +  command

  This command adds two numbers.

  Examples:



       > 12.5
       [ 1]                      12.5
       > 3.7
       [ 2]                      12.5
       [ 1]                       3.7
       > +
       [ 1]                      16.2
       > (1, 3) (-2 4)
       [ 3]                      16.2
       [ 2]                     (1,3)
       [ 1]                    (-2,4)
       > +
       [ 2]                      16.2
       [ 1]                    (-1,7)







  4.2.  The -  command

  This command subtracts two numbers.

  Examples:





  > 15.7 3.2
  [ 2]                      15.7
  [ 1]                       3.2
  > -
  [ 1]                      12.5
  > (4 -3) (1 -1)
  [ 3]                      12.5
  [ 2]                    (4,-3)
  [ 1]                    (1,-1)
  > -
  [ 2]                      12.5
  [ 1]                    (3,-2)






  4.3.  The *  command

  This command multiplies two numbers.

  Examples:



       > 3.4 -5.2 *
       [ 1]                    -17.68
       > (4, 2) (3 -1) *
       [ 2]                    -17.68
       [ 1]                    (14,2)






  4.4.  The /  command

  This command divides two numbers.

  Examples:



       > 10 3 /
       [ 1]          3.33333333333333
       > (4 8) (2 2)
       [ 3]          3.33333333333333
       [ 2]                     (4,8)
       [ 1]                     (2,2)
       > /
       [ 2]          3.33333333333333
       [ 1]                     (3,1)







  4.5.  The inv  command

  This command returns one divided by a number.


  Examples:



       > 5 inv
       [ 1]                       0.2
       > (4 2)
       [ 2]                       0.2
       [ 1]                     (4,2)
       > inv
       [ 2]                       0.2
       [ 1]                (0.2,-0.1)






  4.6.  The mod  command

  This command returns the remainder of the division of y (level two)
  and x (level one).

  Example:



       > 10 3 mod
       [ 1]                         1






  4.7.  The chs  and neg  commands

  Thesse commands change the sign of a number.

  Examples:



       > 4
       [ 1]                         4
       > chs
       [ 1]                        -4
       > neg
       [ 1]                         4







  4.8.  The abs  command

  This command returns the absolute value of a number. For real numbers,
  this is equal to the number without its sign. For complex number, it
  is the square root of the sum of the squares of the real and imaginary
  parts.

  Examples:


       > 4 abs
       [ 1]                         4
       > -5 abs
       [ 2]                         4
       [ 1]                         5
       > (3 4)
       [ 3]                         4
       [ 2]                         5
       [ 1]                     (3,4)
       > abs
       [ 3]                         4
       [ 2]                         5
       [ 1]                         5






  4.9.  The ceil  command

  This command returns the smallest integer greater than or equal to its
  input.

  Examples:



       > 3.9 ceil
       [ 1]                         4
       > -3.9 ceil
       [ 2]                         4
       [ 1]                        -3






  4.10.  The floor  command

  This command returns the greatest integer less than or equal to its
  input.

  Examples:



       > 3.9 floor
       [ 1]                         3
       > -3.9 floor
       [ 2]                         3
       [ 1]                        -4






  4.11.  The ip  command

  This command returns the integer part of its input.

  Examples:


       > pi
       [ 1]          3.14159265358979
       > ip
       [ 1]                         3






  4.12.  The fp  command

  This command returns the fractional part of its input.

  Examples:



       > pi
       [ 1]          3.14159265358979
       > fp
       [ 1]         0.141592653589793







  4.13.  The %of  command

  This command returns y (level two) percent of x (level one).

  Examples:


       > 200 25 %of
       [ 1]                        50
       > 314 13.9 %of
       [ 2]                        50
       [ 1]                    43.646







  4.14.  The %t  command

  This command returns the percent of the level two argument that is
  represented by the level one argument.

  Examples:



       > 200 25 %t
       [ 1]                      12.5
       > 520 52 %t
       [ 2]                      12.5
       [ 1]                        10




  4.15.  The %ch  command

  This command returns the percentage change from y (level two) to x
  (level 1) as a percentage of y.

  Examples:



       > 150 175 %ch
       [ 1]          16.6666666666667
       > 215 190 %ch
       [ 2]          16.6666666666667
       [ 1]         -11.6279069767442






  4.16.  The gcd  command

  This command returns the greatest common divisor of two numbers.

  Examples:



       > 411056775237 61754894058 gcd
       [ 1]                      1257
       > 895324789 3745907 gcd
       [ 2]                      1257
       [ 1]                         1






  4.17.  The lcm  command

  This command returns the least common multiple of two numbers.

  Examples:



       > 799984123 239874 lcm
       [ 1]           191895391520502
       > 104890 2349002 lcm
       [ 2]           191895391520502
       [ 1]              123193409890







  5.  Exponential and Logarithmic Commands

  5.1.  The exp  command

  This command returns e raised to its argument.


  Examples:



       > 1 exp
       [ 1]          2.71828182845905
       > 3.7 exp
       [ 2]          2.71828182845905
       [ 1]          40.4473043600674
       > pi (0, 1) * exp
       [ 3]          2.71828182845905
       [ 2]          40.4473043600674
       [ 1] (-1,1.22460635382238e-16)






  5.2.  The ln  command

  This command returns the natural logarithm (base e) of its argument.

  Examples:



       > 4
       [ 1]                         4
       > ln
       [ 1]          1.38629436111989
       > (3 2)
       [ 2]          1.38629436111989
       [ 1]                     (3,2)
       > ln
       [ 2]          1.38629436111989
       [ 1] (1.28247467873077,
            0.588002603547568)






  5.3.  The ^  command

  This command raises y (level two) to x (level one).

  Examples:

















  > 2 10 ^
  [ 1]                      1024
  > 3.75 2.48 ^
  [ 2]                      1024
  [ 1]           26.521467069654
  > (2 3) (1 -1)
  [ 4]                      1024
  [ 3]           26.521467069654
  [ 2]                     (2,3)
  [ 1]                    (1,-1)
  > ^
  [ 3]                      1024
  [ 2]           26.521467069654
  [ 1] (9.20434248861135,
       -2.84401950837022)






  5.4.  The xroot  command

  This command returns the nth (level one) root of x (level two).

  Examples:



       > 2472806570256 4 xroot
       [ 1]                      1254







  5.5.  The sq  command

  This command squares its argument.

  Examples:



       > 16 sq
       [ 1]                       256
       > (2 1)
       [ 2]                       256
       [ 1]                     (2,1)
       > sq
       [ 2]                       256
       [ 1]                     (3,4)






  5.6.  The sqrt  command

  This command returns the square root of its argument.

  Examples:

       > 32041 sqrt
       [ 1]                       179
       > (14229, -37620) sqrt
       [ 2]                       179
       [ 1]                (165,-114)
       > -100 sqrt
       [ 3]                       179
       [ 2]                (165,-114)
       [ 1] (6.12303176911189e-16,10)






  5.7.  The expm1  command

  This command returns exp(x) - 1. It is more accurate than exp when x
  is close to zero.

  Examples:



       > 3.5 expm1
       [ 1]          32.1154519586923
       > -4.2 expm1
       [ 2]          32.1154519586923
       [ 1]        -0.985004423179522






  5.8.  The lnp1  command

  This command returns ln(1 + x). It is more accurate than ln when x is
  close to zero.

  Examples:



       > 45 lnp1
       [ 1]           3.8286413964891
       > 72.5 lnp1
       [ 2]           3.8286413964891
       [ 1]          4.29728540621879






  5.9.  The log  command

  This command returns the decimal (base 10) logarithm of its argument.

  Examples:






  > 1e20 log
  [ 1]                        20
  > 1724.3123 log
  [ 2]                        20
  [ 1]          3.23661592615434






  5.10.  The alog  command

  This command raises 10 to its argument.

  Examples:



       > 21 alog
       [ 1]                     1e+21
       > 7.1524
       [ 2]                     1e+21
       [ 1]                    7.1524
       > alog
       [ 2]                     1e+21
       [ 1]          14203651.2404801







  6.  Trigonometric commands

  6.1.  The pi  command

  This command puts the constant pi (3.14159...) in the stack.

  Example:



       > pi
       [ 1]          3.14159265358979






  6.2.  The sin  command

  This command returns the sine of its argument.

  Example:









  > set anglemode rad
  > pi 2 / sin
  [ 1]                         1
  > pi 3 * 2 / sin
  [ 2]                         1
  [ 1]                        -1






  6.3.  The cos  command

  This command returns the co-sine of its argument.

  Examples:



       > set anglemode rad
       > pi 2 / cos
       [ 1]      6.12303176911189e-17
       > pi chs cos
       [ 2]      6.12303176911189e-17
       [ 1]                        -1






  6.4.  The tan  command

  This command returns the tangent of its argument.

  Examples:



       > set anglemode rad
       > pi 4 / tan
       [ 1]        0.0137086425343941
       > .5 tan
       [ 2]        0.0137086425343941
       [ 1]       0.00872686779075879






  6.5.  The asin  command

  This command returns the arc sine of its argument.

  Examples:









  > .5 asin
  [ 1]         0.523598775598299
  > 1 asin
  [ 2]         0.523598775598299
  [ 1]           1.5707963267949
  > 2 asin
  [ 3]         0.523598775598299
  [ 2]           1.5707963267949
  [ 1] (1.5707963267949,
       -1.31695789692482)






  6.6.  The acos  command

  This command returns the arc co-sine of its argument.

  Examples:



       > set anglemode rad
       > .5 acos
       [ 1]           1.0471975511966
       > 1 acos
       [ 2]           1.0471975511966
       [ 1]                         0
       > 2 acos
       [ 3]           1.0471975511966
       [ 2]                         0
       [ 1]     (0,-1.31695789692482)






  6.7.  The atan  command

  This command returns the arc tangent of its argument.

  Examples:



       > set anglemode rad
       > 1 atan
       [ 1]         0.785398163397448
       > 2 atan
       [ 2]         0.785398163397448
       [ 1]          1.10714871779409
       > .2 atan
       [ 3]         0.785398163397448
       [ 2]          1.10714871779409
       [ 1]         0.197395559849881








  6.8.  The atan2  command

  This command returns the arc tangent of y/x, where y is in level two
  and x is in level one. The signs of both arguments are used to
  calculate the quadrant of the result.

  Examples:



       > set anglemode rad
       > -4 -1.7 / atan
       [ 1]          1.16892567935444
       > -4 -1.7 atan2
       [ 2]          1.16892567935444
       [ 1]         -1.97266697423535






  6.9.  The d>r  command

  This command converts from degrees to radians.

  Examples:



       > 45 d>r
       [ 1]         0.785398163397448
       > 60 d>r
       [ 2]         0.785398163397448
       [ 1]           1.0471975511966






  6.10.  The r>d  command

  This command converts from radians to degrees.

  Examples:



       > pi r>d
       [ 1]                       180
       > pi 3 / r>d
       [ 2]                       180
       [ 1]                        60







  7.  Hyperbolic commands




  7.1.  The sinh  command

  This command returns the hyperbolic sine of its argument.

  Examples:



       > 2 sinh
       [ 1]          3.62686040784702
       > (3 4) sinh
       [ 2]          3.62686040784702
       [ 1] (-6.548120040911,
            -7.61923172032141)






  7.2.  The cosh  command

  This command returns the hyperbolic co-sine of its argument.

  Examples:



       > 2 cosh
       [ 1]          3.76219569108363
       > (3 4) cosh
       [ 2]          3.76219569108363
       [ 1] (-6.58066304055116,
            -7.58155274274654)






  7.3.  The tanh  command

  This command returns the hyperbolic tangent of its argument.

  Examples:



       > 2 tanh
       [ 1]         0.964027580075817
       > (3 4) tanh
       [ 2]         0.964027580075817
       [ 1] (1.00070953606723,
            0.00490825806749603)






  7.4.  The asinh  command

  This command returns the hyperbolic arc sine of its argument.

  Examples:

       > 2 asinh
       [ 1]          1.44363547517881
       > (4 -1) asinh
       [ 2]          1.44363547517881
       [ 1] (2.12255012381007,
            -0.238317461809866)






  7.5.  The acosh  command

  This command returns the hyperbolic arc co-sine of its argument.

  Exmamples:



       > 2 acosh
       [ 1]          1.31695789692482
       > (4 -1) acosh
       [ 2]          1.31695789692482
       [ 1] (2.09659645728889,
            -0.252179408716353)
       > .5 acosh
       [ 3]          1.31695789692482
       [ 2] (2.09659645728889,
            -0.252179408716353)
       [ 1]       (0,1.0471975511966)






  7.6.  The atanh  command

  This command returns the hyperbolic arc tangent of its argument.

  Examples:



       > .5 atanh
       [ 1]         0.549306144334055
       > (4 5) atanh
       [ 2]         0.549306144334055
       [ 1] (0.0964156202029962,
            1.44830699523146)
       > 2 atanh
       [ 3]         0.549306144334055
       [ 2] (0.0964156202029962,
            1.44830699523146)
       [ 1] (0.549306144334055,
            -1.5707963267949)









  8.  Stack manipulation commands

  8.1.  The dup  command

  This command makes a copy of the number in level one.

  Examples:



       > 11 22
       [ 2]                        11
       [ 1]                        22
       > dup
       [ 3]                        11
       [ 2]                        22
       [ 1]                        22






  8.2.  The dup2  command

  This command makes copies of the numbers in levels one and two.

  Examples:



       > 11 22
       [ 2]                        11
       [ 1]                        22
       > dup2
       [ 4]                        11
       [ 3]                        22
       [ 2]                        11
       [ 1]                        22






  8.3.  The dupn  command

  This command takes a number as argument. Only the integer part of that
  number is considered. It makes copies of n (given as argument) stack
  elements.

  Examples:














  > 11 22 33 44
  [ 4]                        11
  [ 3]                        22
  [ 2]                        33
  [ 1]                        44
  > 4 dupn
  [ 8]                        11
  [ 7]                        22
  [ 6]                        33
  [ 5]                        44
  [ 4]                        11
  [ 3]                        22
  [ 2]                        33
  [ 1]                        44






  8.4.  The drop  command

  This command removes the element in level one. Caution: once dropped,
  there is no way to bring a number back.

  Examples:



       > 11 22
       [ 2]                        11
       [ 1]                        22
       > drop
       [ 1]                        11
       > drop






  8.5.  The drop2  command

  This command removes the  in levels one and two. Caution: once
  dropped, there is no way to bring a number back.

  Examples:



       > 11 22 33
       [ 3]                        11
       [ 2]                        22
       [ 1]                        33
       > drop2
       [ 1]                        11






  8.6.  The dropn  command

  This command removes n (in level one) elements from the stack.
  Caution: once dropped, there is no way to bring a number back.
  Examples:



       > 11 22 33 44
       [ 4]                        11
       [ 3]                        22
       [ 2]                        33
       [ 1]                        44
       > 3 dropn
       [ 1]                        11






  8.7.  The clear  command

  This command removes all elements from the stack. Caution: once
  dropped, there is no way to bring a number back.

  Examples:



       > 11 22 33 44
       [ 4]                        11
       [ 3]                        22
       [ 2]                        33
       [ 1]                        44
       > clear






  8.8.  The swap  command

  This command swaps the elements in levels one and two, that is, the
  element that was in level one now is in level two, and the element
  that was in level two now is in level one.

  Examples:



       > 11 22
       [ 2]                        11
       [ 1]                        22
       > swap
       [ 2]                        22
       [ 1]                        11






  8.9.  The over  command

  This command makes puts a copy of the element in level two in the
  stack. (Equivalent to 3 PICK.)


  Examples:



       > 11 22
       [ 2]                        11
       [ 1]                        22
       > over
       [ 3]                        11
       [ 2]                        22
       [ 1]                        11






  8.10.  The pick  command

  This command takes an argument n. It makes a copy of the element in
  level n+1.

  Examples:



       > 11 22 33 44
       [ 4]                        11
       [ 3]                        22
       [ 2]                        33
       [ 1]                        44
       > 3 pick
       [ 5]                        11
       [ 4]                        22
       [ 3]                        33
       [ 2]                        44
       [ 1]                        22






  8.11.  The rot  command

  This command rolls levels one, two and three upwards. The number in
  level three goes to level one, the number in level two goes to level
  three and the number in level one goes to level two. (Equivalent to 3
  ROLL.)

  Examples:



       > 11 22 33
       [ 3]                        11
       [ 2]                        22
       [ 1]                        33
       > rot
       [ 3]                        22
       [ 2]                        33
       [ 1]                        11




  8.12.  The unrot  command

  This command rolls levels one, two and three downwards. The number in
  level one goes to level three, the number in level two goes to level
  one and the number in level three goes to level two. (Equivalent to 3
  ROLLD.)

  Examples:



       > 11 22 33
       [ 3]                        11
       [ 2]                        22
       [ 1]                        33
       > unrot
       [ 3]                        33
       [ 2]                        11
       [ 1]                        22






  8.13.  The roll  command

  This command rolls levels from two to n+1 (n is in level one) upwards.

  Examples:



       > 11 22 33 44
       [ 4]                        11
       [ 3]                        22
       [ 2]                        33
       [ 1]                        44
       > 4 roll
       [ 4]                        22
       [ 3]                        33
       [ 2]                        44
       [ 1]                        11






  8.14.  The rolld  command

  This command rolls levels from two to n+1 (n is in level one)
  downwards.

  Examples:











  > 11 22 33 44
  [ 4]                        11
  [ 3]                        22
  [ 2]                        33
  [ 1]                        44
  > 4 rolld
  [ 4]                        44
  [ 3]                        11
  [ 2]                        22
  [ 1]                        33






  8.15.  The depth  command

  This command puts the number of elements in the stack in level one.

  Examples:



       > 11 22 33
       [ 3]                        11
       [ 2]                        22
       [ 1]                        33
       > depth
       [ 4]                        11
       [ 3]                        22
       [ 2]                        33
       [ 1]                         3








  9.  Miscellaneous commands

  9.1.  The rand  command

  This command returns a random number from 0 (inclusive) to 1
  (exclusive).



  9.2.  The rdz  command

  This command takes a number as argument, and stores that number as the
  random number generator seed. If the argument is 0, then a seed is
  generated from the current time.



  9.3.  The !  command

  This command returns the factorial of the number given as argument.
  For non-integers, it returns gamma(x + 1).

  Examples:


       > 5 !
       [ 1]                       120
       > 6.3 !
       [ 2]                       120
       [ 1]          1271.42363366391






  9.4.  The lgamma  command

  This command returns the logarithm of the absolute value of the gamma
  function of its argument.

  Examples:



       > 6.3 lgamma
       [ 1]          5.30734288962476






  9.5.  The perm  command

  This command returns the number of permutations of n elements (level
  two) taken m by m (level one.)

  Examples:



       > 10 3 perm
       [ 1]                       720






  9.6.  The comb  command

  This command returns the number of combinations of n elements (level
  two) taken m by m (level one.)

  Examples:



       > 10 3 comb
       [ 1]                       120






  9.7.  The min  command

  This command returns the smallest of its two arguments.

  Examples:



       > 3 4 min
       [ 1]                         3






  9.8.  The max  command

  This command returns the largest of its two arguments.

  Examples:



       > 3 4 max
       [ 1]                         4






  9.9.  The sign  command

  For real numbers, this command returns -1 if the number is negative, 0
  if it is zero or 1 if it is positive. For complex numbers, it returns
  the unit vector in the direction of a complex number.

  Examples:



       > -6 sign
       [ 1]                        -1
       > 0 sign
       [ 2]                        -1
       [ 1]                         0
       > 8 sign
       [ 3]                        -1
       [ 2]                         0
       [ 1]                         1
       > (3, 4) sign
       [ 4]                        -1
       [ 3]                         0
       [ 2]                         1
       [ 1]                 (0.6,0.8)






  9.10.  The psign  command

  This command returns -1 if the number is negative, or 1 if it is
  positive or zero.

  Examples:


       > -6 psign
       [ 1]                        -1
       > 0 psign
       [ 2]                        -1
       [ 1]                         1
       > 8 psign
       [ 3]                        -1
       [ 2]                         1
       [ 1]                         1






  9.11.  The mant  command

  This command returns the mantissa of its argument.

  Examples:



       > 1.3515413566333e20
       [ 1]       1.3515413566333e+20
       > mant
       [ 1]           1.3515413566333






  9.12.  The xpon  command

  This command returns the exponent of its argument.

  Examples:



       > 1.3515413566333e20
       [ 1]       1.3515413566333e+20
       > xpon
       [ 1]                        20






  9.13.  The rnd  command

  This command truncates the level two argument (a real or complex
  number) to n (in level one) decimal places.

  Examples:



       > pi
       [ 1]          3.14159265358979
       > 4 rnd
       [ 1]                    3.1416


  9.14.  The type  command

  This command returns the type of its argument. The type is one of the
  following:


     0  A real number

     1  A complex number

     2  A string

     6  An identifier

  Examples:



       > 45 type
       [ 1]                         0
       > "Hello World" type
       [ 2]                         0
       [ 1]                         2






  9.15.  The =  command

  This command is special. It allows you to override the number of stack
  elements to show, but only for the next time the stack is displayed.
  It accepts an argument, but not from the stack. If there is a number
  immediately following the ``='' command, it is treated as the number
  of elements to display. If there is no number, or the number is less
  than or equal to zero, the whole stack is displayed. Note that there
  must be no space between the number and the ``='' sign.



  9.16.  The shell  command

  The shell command is used to run commands from calc. To run a command,
  just enter shell COMMAND. The command will be run, and after it
  finishes, a message will be displayed asking you to press ENTER. When
  you're done examining the output of the command, press ENTER to return
  to calc.

  If you do not specify a command for the shell command, an interactive
  shell will be called instead. When you're finished, exit the shell as
  usual, normally by entering exit at the prompt or pressing CTRL-D.




  10.  Time and date commands

  You can use calc to do some operations on time and dates, such as
  calculating how many days are there between two dates.

  Dates are entered in the format MM.DDYYYY, that is, the month is the
  integer part, the fractional part is the day and the year.

  For example, the 26th of April of 1999 would be represented as
  4.261999.
  Times are entered in a similar format: HH.MMSS, that is, the hour is
  the integer part, and the fractional part contains the minutes and
  seconds. The hour is always in 24-hour format. So, 1:30:45pm would be
  represented as 13.3045.

  You should not that whenever time is involved, the hours can be though
  as degrees, so the functions related to time are useful for dealing
  with angles in sexagesimal notation.

  Here is a list of the commands related to time and dates:


  10.1.  The date  command

  This command puts the current date in the stack.

  Example:



       > date
       [ 1]                  5.021999







  10.2.  The time  command

  This command puts the current time in the stack.

  Example:



       > time
       [ 1]                   15.1941






  10.3.  The >hms  command

  This command converts time (or angles) in decimal format to HH.MMSS
  format.

  Examples:



       > 15.3030 >hms
       [ 1]                  15.18108
       > 5.4559 >hms
       [ 2]                  15.18108
       [ 1]                  5.272124







  10.4.  The hms>  command

  This command converts time (or angles) in HH.MMSS format to decimal
  format.

  Examples:



       > 15.18108 hms>
       [ 1]                    15.303
       > 5.272124 hms>
       [ 2]                    15.303
       [ 1]                    5.4559






  10.5.  The date+  command

  This command adds an specified number of days (in level one) to a date
  (in level two).

  Examples:



       > 4.291999 15 date+
       [ 1]                  5.141999
       > 6.201999 60 date+
       [ 2]                  5.141999
       [ 1]                  8.191999






  10.6.  The ddays  command

  This command returns the number of days between two dates.

  Examples:



       > 4.291999 5.141999 ddays
       [ 1]                        15
       > 6.201999 8.191999 ddays
       [ 2]                        15
       [ 1]                        60






  10.7.  The hms+  command

  This command adds time (or angles) in HH.MMSS format.

  Examples:


       > 22.59 .01 hms+
       [ 1]                        23
       > 7.3045 .4530 hms+
       [ 2]                        23
       [ 1]                    8.1615






  10.8.  The hms-  command

  This command subtracts time (or angles) in HH.MMSS format.

  Examples:



       > 23 22.59 hms-
       [ 1]        0.0100000000000001
       > 8.1615 7.3045 hms-
       [ 2]        0.0100000000000001
       [ 1]                     0.453






  10.9.  The dow  command

  This command returns the day of the week for a given date. The
  returned values are 0 for Sunday, 1 for Monday, etc...

  Examples:



       > date
       [ 1]                  5.021999
       > dow
       [ 1]                         0
       > 5.031999 dow
       [ 2]                         0
       [ 1]                         1






  10.10.  The dowstr  command

  This command returns a string with the three-letter abbreviation of
  the day of the week of a given date.

  Examples:








  > date
  [ 1]                  5.021999
  > dowstr
  [ 1]                     "Sun"
  > 5.031999 dowstr
  [ 2]                     "Sun"
  [ 1]                     "Mon"






  10.11.  The tstr  command

  This command takes as argument a date (in level two) and a time (in
  level one), and returns a string representing that time and date.

  Example:


       > date
       [ 1]                  4.271999
       > time
       [ 2]                  4.271999
       [ 1]                   15.3257
       > tstr
       [ 1] "Tue 04/27/1999  15:32:57...








  11.  Complex number commands

  11.1.  The r>c  command

  This command takes two real numbers as arguments, and returns a
  complex number whose real part is the level two argument and whose
  imaginary part is the level one argument.

  Examples:



       > pi 1 exp
       [ 2]          3.14159265358979
       [ 1]          2.71828182845905
       > r>c
       [ 1] (3.14159265358979,
            2.71828182845905)







  11.2.  The re>c  command

  This command takes a real number as argument, and returns a complex
  number whose real part is its argument and whose imaginary part is
  zero.
  Examples:



       > pi
       [ 1]          3.14159265358979
       > re>c
       [ 1]      (3.14159265358979,0)






  11.3.  The im>c  command

  This command takes a real number as argument, and returns a complex
  number whose real part is zero and whose imaginary part is its
  argument.

  Examples:



       > pi
       [ 1]          3.14159265358979
       > im>c
       [ 1]      (0,3.14159265358979)






  11.4.  The c>r  command

  This command takes a complex number as argument and returns two real
  numbers, representing its real and imaginary parts.

  Examples:



       > (3, -4)
       [ 1]                    (3,-4)
       > c>r
       [ 2]                         3
       [ 1]                        -4






  11.5.  The re  command

  This command takes a complex number as argument and returns a real
  number representing its real part.

  Examples:






  > (3, -4)
  [ 1]                    (3,-4)
  > re
  [ 1]                         3





  11.6.  The im  command

  This command takes a complex number as argument and returns a real
  number representing its imaginary part.

  Examples:



       > (3, -4)
       [ 1]                    (3,-4)
       > im
       [ 1]                        -4






  11.7.  The conj  command

  This command returns the conjugate of its argument.



       > (3, -4)
       [ 1]                    (3,-4)
       > conj
       [ 1]                     (3,4)






  11.8.  The arg  command

  This command returns the argument of a complex number, that is, it's
  angle when represented in polar form.

  Examples:



       > set anglemode deg
       > (4 4)
       [ 1]                     (4,4)
       > arg
       [ 1]                        45
       > (-2 4)
       [ 2]                        45
       [ 1]                    (-2,4)
       > arg
       [ 2]                        45
       [ 1]          116.565051177078


  12.  Relational commands

  The commands in this section deal with flags. A flag is just a real
  number. If its value is 0, the flag is false. Any other value means
  true.


  12.1.  The ==  command

  This command compares its two arguments and returns 1 if they are
  equal.

  Examples:



       > 4 4 ==
       [ 1]                         1
       > 4 5 ==
       [ 2]                         1
       [ 1]                         0






  12.2.  The !=  and #  commands

  These commands (they are actually the same command, but with two
  names) compare their two arguments and return 1 if they are not equal,
  that is, different.

  Examples:



       > 4 4 !=
       [ 1]                         0
       > 4 5 #
       [ 2]                         0
       [ 1]                         1






  12.3.  The <  command

  This command compares its arguments and returns 1 if the one in level
  two is less than the one in level one.

  Examples:



       > 4 6 <
       [ 1]                         1
       > 4 -2 <
       [ 2]                         1
       [ 1]                         0




  12.4.  The >  command

  This command compares its arguments and returns 1 if the one in level
  two is greater than the one in level one.

  Examples:



       > 4 6 >
       [ 1]                         0
       > 4 -2 >
       [ 2]                         0
       [ 1]                         1






  12.5.  The <=  command

  This command compares its arguments and returns 1 if the one in level
  two is less than or equal to the one in level one.

  Examples:



       > 4 5 <=
       [ 1]                         1
       > 4 4 <=
       [ 2]                         1
       [ 1]                         1
       > 4 3 <=
       [ 3]                         1
       [ 2]                         1
       [ 1]                         0






  12.6.  The >=  command

  This command compares its arguments and returns 1 if the one in level
  two is greater than or equal to the one in level one.

  Examples:



       > 4 5 >=
       [ 1]                         0
       > 4 4 >=
       [ 2]                         0
       [ 1]                         1
       > 4 3 >=
       [ 3]                         0
       [ 2]                         1
       [ 1]                         1




  12.7.  The and  command

  This command performs a logical and between two flags. The result is 1
  if both flags are true.

  Examples:



       > 1 0 and
       [ 1]                         0
       > 1 1 and
       [ 2]                         0
       [ 1]                         1






  12.8.  The or  command

  This command performs a logical or between two flags. The result is 1
  if either flag is true.

  Examples:



       > 1 0 or
       [ 1]                         1
       > 0 0 or
       [ 2]                         1
       [ 1]                         0






  12.9.  The xor  command

  This command performs a logical xor between two flags. The result is 1
  if only one of the flags is true.

  Examples:



       > 0 1 xor
       [ 1]                         1
       > 1 1 xor
       [ 2]                         1
       [ 1]                         0






  12.10.  The not  command

  This command inverts the flag given as argument to it. A true becomes
  a false, and a false becomes a true.


  Examples:



       > 1 not
       [ 1]                         0
       > not
       [ 1]                         1







  13.  String commands

  In addition to being able to manipulate real numbers, calc is also
  capable of dealing with strings. To include a string in the stack,
  enter the string between double quotes, for example:



       > "This is a string"
       [ 1]        "This is a string"
       >




  There is no limit on the size of a string, it is limited only by the
  available memory. I've been able to successfully put a 15-megabyte
  string in the stack. However, I'd not recommend trying to do this
  unless you have a lot of memory. And don't try this on MS-DOS either.

  The commands which deal with strings are:



  13.1.  The +  command (for strings)

  The + command, when at least one argument is a string, does string
  concatenation. The string at level one is appended at the end of the
  string at level two. If one of the two arguments is not a string, it
  will be converted to a string.

  Examples:



       > "Hello, " "World!"
       [ 2]                 "Hello, "
       [ 1]                  "World!"
       > +
       [ 1]           "Hello, World!"
       > 45 +
       [ 1]         "Hello, World!45"









  13.2.  The size  command

  This command returns a real number representing the size of the string
  given as argument, in bytes.

  Examples:



       > "Hello, World!"
       [ 1]           "Hello, World!"
       > size
       [ 1]                        13






  13.3.  The >str  command

  This command converts its argument to a string representing it.
  Numbers are converted using the current setting of precision, number
  format and coordinate mode (see section ``Customization''). Strings
  are not modified.

  Examples:



       > (1, 3)
       [ 1]                     (1,3)
       > >str
       [ 1]                   "(1,3)"
       > 4 >str
       [ 2]                   "(1,3)"
       [ 1]                       "4"






  13.4.  The str>  command

  This command takes a string as argument, and evaluates it as if it
  were a series of commands typed at command line.

  Example:



       > "6 16 sqrt +"
       [ 1]             "6 16 sqrt +"
       > str>
       [ 1]                        10






  13.5.  The num  command

  This command takes a string and returns a real number, whose value is
  the ASCII code for the first character of the string.
  Examples:



       > "A"
       [ 1]                       "A"
       > num
       [ 1]                        65
       > "c" num
       [ 2]                        65
       [ 1]                        99






  13.6.  The chr  command

  This command takes a real number representing an ASCII code as
  argument, and returns a string with the character that code
  represents.

  Examples:



       > 65 chr
       [ 1]                       "A"
       > 99 chr
       [ 2]                       "A"
       [ 1]                       "c"






  13.7.  The head  command

  This command takes a string and returns another string containing just
  the first character of the string.

  Examples:



       > "Hello, World"
       [ 1]            "Hello, World"
       > head
       [ 1]                       "H"






  13.8.  The tail  command

  This command takes a string and returns another string containing the
  input string minus its first character.

  Examples:



  > "Hello, World"
  [ 1]            "Hello, World"
  > tail
  [ 1]             "ello, World"






  13.9.  The pos  command

  This command takes two strings as argument. The string in level one is
  searched in the string in level two. A real number is returned,
  representing the position of the start of the substring in the string.
  If no match was found, zero is returned.

  Examples:



       > "Hello, World" "W" pos
       [ 1]                         8
       > "Hello, World" "x" pos
       [ 2]                         8
       [ 1]                         0






  13.10.  The sub  command

  This command takes three arguments: a string in level three, and two
  real numbers in levels two and one, representing the starting position
  and the ending position. A new string is returned, which is a the part
  of the input string between the starting and ending positions,
  inclusive.

  If the starting position is less than one, it is considered as one. If
  the ending position is greater than the length of the string, it is
  considered as the length of the string. If the ending position is less
  than the starting position, an empty string is returned.

  Examples:



       > "Hello, World"
       [ 1]            "Hello, World"
       > 4 8 sub
       [ 1]                   "lo, W"
       > 3 3 sub
       [ 1]                       ","






  13.11.  The repl  command

  This command takes three arguments: a string in level three, a real
  number in level two and another string in level one. The characters of
  the string in level three, starting at the position in level two, are
  substituted by the string in level one.

  Examples:



       > "Hello John" 7 "Mary" repl
       [ 1]              "Hello Mary"
       > 7 "L" repl
       [ 1]              "Hello Lary"
       > 10 "ry" repl
       [ 1]             "Hello Larry"






  13.12.  The str>id  and $>id  commands

  These command convert the string in level one to an identifier.

  Examples:



       > "Hello"
       [ 1]                   "Hello"
       > str>id
       [ 1]                   'Hello'
       > "World" $>id
       [ 2]                   'Hello'
       [ 1]                   'World'






  13.13.  The id>str  and id>$  commands

  These commands convert the identifier in level one to a string.  The
  difference between these commands and >str is that the latter inserts
  the quotes as part of the string.

  Examples:



       > 'Hello'
       [ 1]                   'Hello'
       > id>str
       [ 1]                   "Hello"
       > 'World' id>$
       [ 2]                   "Hello"
       [ 1]                   "World"
       > 'World' >str
       [ 3]                   "Hello"
       [ 2]                   "World"
       [ 1]                 "'World'"






  14.  Using the memory

  Besides the stack, all objects that can be present in calc can also be
  stored in another place: the memory. This is a permanent place of
  storage, and has no fixed size: you can store as many objects as your
  memory can hold.

  To store an object in memory, you must give it a name, which will be
  used to bring that object back whenever you want to. A name in calc is
  called an identifier. It is like a string, but it is delimited by
  single quotes. Unlike in the HP48 calculator, identifiers in calc can
  contain any character, including characters invalid in the HP48 such
  as space, +, *, etc. The identifier may even by the empty name: ''.

  To store an object, put that object in level two of the stack, and on
  level one an identifier. Then run the command sto. This will store the
  object.

  To recall an object from memory, put in the stack the name of the
  object, and run the rcl command. The stack will contain a copy of the
  object, but the memory will not be affected -- you can recall any
  object as many times as you want.

  There is an easier way to recall objects: instead of entering the
  identifier between single quotes and running rcl, just enter the
  object's name without quotes, as if it were a command. You'll get the
  object in the stack. If there is no object with that name, you'll get
  the indentifier in the stack. This will not work if the name has
  spaces, however -- in this case you'll need to first put the
  identifier in the stack and then run the rcl command.

  When you exit calc the contents of the memory are stored in the init
  file (see section ``The Init File''), and restored when you run calc
  again, unless you use the -m command line switch (see section
  ``Command Line Options'').

  Here are some examples of the use of memory:



       > pi
       [ 1]          3.14159265358979
       > 'AConstant'
       [ 2]          3.14159265358979
       [ 1]               'AConstant'
       > sto
       > 'AConstant'
       [ 1]               'AConstant'
       > rcl
       [ 1]          3.14159265358979
       > AConstant
       [ 2]          3.14159265358979
       [ 1]          3.14159265358979






  14.1.  Listing and erasing the memory

  When you want to see all the objects that are stored in memory, use
  the vars command. It will output the names of all the stored objects.
  Here is one example, assuming 'AConstant' is still in memory:


       > 1 exp 'Another Constant'
       [ 2]          2.71828182845905
       [ 1]        'Another Constant'
       > sto
       > "Hello World"
       [ 1]             "Hello World"
       > 'String'
       [ 2]             "Hello World"
       [ 1]                  'String'
       > sto
       > (3, -2) 'cmp' sto
       > vars




  To erase one object from the memory, put that object's name in the
  stack and run the purge command. But be careful: there is no way to
  bring back an erased object.

  If you want to get rid of the whole memory, use the clvar command.
  This command will erase all your memory, and there is no way to bring
  back the erased memory. Because of this, the commands asks you for
  confirmation before doing the operation.



  14.2.  Saving objects to the disk

  In addition to saving objects in calc's memory, objects can also be
  saved to the disk. To do this, put the object in level two, and the
  path of the file you want to save in level one (this is an
  identifier). Then run the disksto command. The object will be saved to
  the named file.

  To recall an object from a file, put the file's path (an identifier)
  in the stack, and run the diskrcl command. If the file contains a
  valid object, it will be loaded in level one.

  If you give a relative path as the name of the file, it is considered
  as relative to the current working directory. To discover which
  directory is this, run the pwd command. It will output the directory.
  To change the current directory, put the directory you want to go to
  in level one (an identifier) and run the cd command.





  15.  Memory commands

  15.1.  The sto  command

  This command stores an object (in level two) in memory, with the name
  given in level one (an identifier).



  15.2.  The rcl  command

  This command recalls from memory the object whose name is in level one
  (an identifier).




  15.3.  The purge  command

  This command deletes from memory the object whose name is in level one
  (and identifier). Be careful: there is no way to bring back an erased
  object.



  15.4.  The clvar  and clusr  commands

  These commands delete the whole contents of memory. Because there is
  no way to bring back the memory contents, these commands asks you for
  confirmation before. Answer 'y' at the prompt to delete the memory.



  15.5.  The _clvar  command

  This command deletes the whole memory, without asking you for
  confirmation before.



  15.6.  The vars  command

  This command displays all objects stored in memory.



  15.7.  The disksto  command

  This command saves the object in level two to a file whose path is
  given in level one (as an identifier).



  15.8.  The diskrcl  command

  This command recalls an object saved in the file whose path is given
  as argument (and identifier) in level one.



  15.9.  The pwd  command

  This command prints the current working directory.

  Examples:



       > pwd
       /home/ekalin/progs/calc






  15.10.  The cd  command

  This command changes the current working directory to the directory
  given as argument (an identifier) in level one.

  Examples:

       > '/usr/bin'
       [ 1]                '/usr/bin'
       > cd
       > pwd
       /usr/bin








  16.  Customization

  Several aspects of calc can be customized. These include, for example,
  the way to display numbers and the angle mode. There are two ways to
  set them: using the set command or using RPN commands (provided to
  make calc compatible with HP48 calculators.) The customizations that
  are not relevant in the HP48 (such as the prompt) can only be set with
  the command set.



  16.1.  The set  command

  The set command has the form:



       > set [directive [option]]




  If used without arguments, it will display all possible options.
  (Equivalent to help set.) If you give it a directive name, but no
  argument, it displays help about it (help set directive) followed by
  the current value (show directive.) And, if you give a directive and a
  value, some paramenter is changed.

  To specify an option with a space, you must include the whole option
  between quotes, for example:



       > set prompt "(calc) "




  The show command is used to display the current value of an option. If
  used with no arguments, it displays all possible values (equivalent to
  help show.) If given an option name, it displays the current value of
  that option.



  16.2.  Options that can be set

  16.2.1.  Angle mode

  The angle mode can be set to radians (the default) or degrees. To set
  it, use the set command this way:


       > set anglemode {deg|rad}




  The RPN equivalents are rad and deg. Both take no arguments, and
  return no values.



  16.2.2.  Coordinate mode

  The coordinate system can be set to rectangular (the default) or
  polar. To set it, use the set command as follows:



       > set anglemode {rect|polar|cylin}




  Specifying rect selects rectanguar mode, and polar or cylin can be
  used to select polar mode.

  You can also use the command rect and polar (or cylin) to select the
  coordinate mode.



  16.2.3.  Number display format and precision

  These options are closely related. The number display format specifies
  how the numbers will be shown (the four available formats are
  described below), and the precision the number of decimal places to
  show in each mode. Note that precision does not really alter the
  precision of the calculator; all calculations are done using all
  possible precision numbers, but not all must be shown should you want
  it this way.

  To set the number format, use the command



       > set number-format {std|fix|sci|eng}




  The available number formats are:



     std
        The ``standard'' mode is the common mode for displaying numbers:
        if possible, the number is not displayed in scientific notation,
        and decimal places are only shown if they are present. Up to 15
        decimal places may be shown, but no trailing zeros are added.


     fix
        The ``fixed precision'' mode always display the number of
        decimal places specified by the precision option. Trailing zeros
        are added if necessary.


     sci
        The ``scientific notation'' mode always displays numbers using
        scientific notation, with the numberof decimal places specified
        by the precision option.


     eng
        The ``engineering notation'' mode displays precision + 1
        significant digits using engineering notation. Engineering
        notation is like scientific notation, but the exponent is always
        a multiple of three.


  To set the precision, use the set command as follows:



       > set precision <n>




  Where <n> is the number of decimal places you want. It must be between
  zero and fifteen, inclusive. Numbers less than zero are treated as
  zero, and numbers greater than fifteen are treated as fifteen. Only
  the integer part of the argument is considered.

  Note that the precision is ignored for the std mode.

  You can also set the precision with the commands std, fix, sci and
  eng. All but std take an argument in level one: the precision.




  16.2.4.  Prompt

  The prompt can be set to anything you want, up to 10 characters long.
  To set it, use the set command this way:



       > set prompt <prompt>




  The only way to set the prompt is using the set command.



  16.2.5.  Number of lines to display

  The number of stack lines to display can be set this way:



       > set lines <x>




  where <x> is the number of lines to display.

  This option can be temporarily overridden by the = command. See ``The
  = command''.
  16.3.  The configuration file

  When you issue a quit or q command, all options are written to a
  configuration file, that is read again the next time you run calc. The
  location of this file varies: on MS-DOS systems, it is called calc.ini
  and is stored in the directory from where calc was run. On other
  systems, it is called .calc and is stored in the home directory (or,
  more precisely, the value of the HOME environment variable.)

  This file is in binary form, and you should not try to alter it in any
  way.

  The stack and memory are also saved in this file when you exit the
  calculator. The next time you run the calculator, the stack is
  restored, unless the -s or -m command line option (see ``Command Line
  Options'') are set.

  If you exit calc with the abort command, then it does not write its
  configuration file.















































