home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d130 / hp.lha / Hp / hp.doc < prev    next >
Text File  |  1988-03-13  |  12KB  |  218 lines

  1.  
  2.                  -----------------------------------------
  3.                /                                           \
  4.               |                    h                        |
  5.               |                   h                         |
  6.               |                  h                          |
  7.               |                 h                           |
  8.               |                h h h      p p p             |
  9.               |               h     h    p     p            |
  10.               |              h     h    p     p             |
  11.               |             h     h    p p p p              |
  12.               |                       p                     |
  13.               |                      p                      |
  14.               |                     p                       |
  15.                \                                           /
  16.                  -----------------------------------------
  17.  
  18.                                Version 1.0
  19.                                 March 1987
  20.                                Steve Bonner
  21.  
  22.  
  23.  
  24.    I.  Introduction.
  25.  
  26.        "hp" is a public domain scientific calculator for the Amiga.
  27.        It uses postfix notation (sometimes referred to as "RPN") and
  28.        supports calculations with binary, octal, decimal, hex, float and
  29.        complex numbers.  Since complex numbers possess both a real and an
  30.        imaginary component, the calculator display shows two numbers at
  31.        a time.  This way the entire complex number may be seen at a
  32.        glance.  As with popular postfix notation calculators, the last
  33.        four numbers entered are stored on a "stack".  With "hp", the
  34.        two most recently-entered numbers (referred to as "x" and "y")
  35.        are always visible.  The other values ("z" and "t") scroll off
  36.        the top of the display, but are still available for use.  Thus,
  37.        four float or integer values may be pushed onto the stack at
  38.        one time, or two complex numbers.
  39.  
  40.   II.  Getting started.
  41.  
  42.        hp can be invoked either by typing "hp" in CLI or by selecting
  43.        its logo from Workbench.  (Of course, you may also type
  44.        "run hp" from CLI if you anticipate a need for multitasking.)
  45.        hp does not use a Workbench window, but instead opens its own
  46.        screen.  To make the hp screen appear in front of or behind the
  47.        Workbench screen, depress the left "Amiga" key (the solid red "A")
  48.        along with the "m" or "n" key, respectively.  When the program
  49.        is initially invoked, the default calculator settings will always
  50.        be in effect.  These are:  float mode, angular measure in degrees
  51.        and print tracing turned off.  The arithmetic mode and angular
  52.        units in effect will always be highlighted in yellow.  The "print"
  53.        key toggles print tracing on and off.  When turned on, "print"
  54.        causes every calculator input, command and result to be sent to
  55.        the printer.
  56.  
  57.  III.  Arithmetic modes.
  58.  
  59.        Six types of numbers may be used when carrying out calculations
  60.        with hp:  binary, octal, decimal, hex, float and complex.  The
  61.        calculator may be in only one of these modes at a time, and all
  62.        elements of the stack will be interpreted as numbers of this
  63.        type.  Note that if complex (CPX) mode is selected, the unary
  64.        operations (affecting a single number, such as sine or logarithm)
  65.        update both x and y registers, while the binary operations (e.g.,
  66.        addition, subtraction ) affect all four stack registers.  If
  67.        the calculator is switched to or from integer mode (e.g., from
  68.        octal to complex or from float to hex) the stack is cleared.
  69.        Between the integer modes, the stack contents are preserved,
  70.        and the x and y registers are displayed accordingly.  Similarly,
  71.        switching between float and complex does not affect the stack.
  72.        (It does, however, affect the way the stack contents are
  73.        interpreted.)
  74.  
  75.        Binary mode.   All integers used by hp are 32-bit signed quantities.
  76.                       Negation is always by 2's complement.  Thus, the binary
  77.                       representation of -1 is a string of 32 ones.
  78.  
  79.        Octal mode.    In octal mode, bits are represented in groups of three.
  80.                       Since the fixed wordsize of 32 is not divisible by
  81.                       3, the two highest-order bits are always grouped by
  82.                       themselves.  Thus, -1 in octal is: 37777777777
  83.  
  84.        Decimal mode.  This is the only integer mode which does not depict
  85.                       numbers as groupings of bits.  For this reason,
  86.                       negative values are displayed in the traditional
  87.                       manner, with a leading minus sign.
  88.  
  89.        Hex mode.      These are numbers base 16.  As is customary, the
  90.                       additional "digits" A through F are provided.
  91.  
  92.        Float mode.    Floating-point numbers are always displayed in
  93.                       scientific notation.
  94.  
  95.        Complex mode.  Complex numbers require two registers for storage.
  96.                       The real part of the number is always entered first,
  97.                       followed by the imaginary part.  Thus, to multiply
  98.                       (3 + 5i) by (2 - i), the following keystrokes would
  99.                       be used:  3 enter 5 enter 2 enter 1 chs x.
  100.                       Note that in complex mode, all numbers-- even complex
  101.                       numbers which are purely real or imaginary-- consist
  102.                       of two distinct parts.  So, to multiply
  103.                       (3 + 5i) by the real number 2, the following would
  104.                       be necessary:  3 enter 5 enter 2 enter 0 x.
  105.  
  106.    IV. User interface.
  107.  
  108.        The hp "keyboard" is designed to look and function as a hand-held
  109.        calculator.  All keys are selected by use of the mouse.  The left
  110.        mouse button is used to click on calculator keys.  (The right mouse
  111.        button is not used by hp.)  The color of the hp display screen
  112.        can be set to any one of 4096 colors by clicking the red, green and
  113.        blue keys on the upper right of the calculator.
  114.  
  115.        Depending on the arithmetic mode of the calculator, not all function
  116.        keys will be active at any one time.  For example, the trig functions
  117.        are not available in integer mode.  This is simply because the sine
  118.        (for example) of a number would always yield a number between plus
  119.        and minus 1, which would in turn always be truncated to plus one,
  120.        minus one or zero.  Similarly, the key for the digit "8" is not
  121.        active in octal mode, because octal numbers consist entirely of
  122.        digits between 0 and 7.  If an inactive key is selected, the hp
  123.        display will briefly flash an orange color to indicate an invalid
  124.        input.
  125.  
  126.        If a numerical error occurs during calculations, the hp display is
  127.        cleared an an appropriate message is issued.  The error messages
  128.        which may arise are:  domain error, singularity, overflow, underflow
  129.        and loss of digits.  The error message display can be acknowledged
  130.        by clicking the left mouse button anywhere on the screen.  An
  131.        error while in integer or float mode will cause the contents of
  132.        the x register to be reset to zero.  For complex numbers, both
  133.        x and y are cleared.
  134.  
  135.    V.  Stack operations.
  136.  
  137.        Five of the blue keys along the bottom of the screen perform
  138.        operations on the stack.  RCLz and RCLt cause the contents of
  139.        register z (or t) to be "pushed" onto the stack.  As always,
  140.        a consequence of pushing a number is that the old contents of
  141.        register t "fall off" of the stack, and are lost.  Note that
  142.        these functions do not move register z or t into x, but instead
  143.        copy into x.  So after a RCLz, the contents of registers x and
  144.        t will be the same.  The LastX function recalls the last number
  145.        explicitly entered by the user.  Computed values which happen to
  146.        have previously resided in x are not obtainable through LastX.
  147.        The key labelled "x<>y"  (sometimes referred to as "swap")
  148.        interchanges the values in the x and y registers.  The "drop"
  149.        key removes (i.e., "pops") the value of x from the top of the
  150.        stack.  The three remaining stack values "move down."  When
  151.        this happens, the value of t is automatically set to zero.
  152.  
  153.   VI.  The printer.
  154.  
  155.        As mentioned above, outputs can be sent to the printer by
  156.        selecting the "Print" key in the lower left of the screen.
  157.        In order to allow for potentially long binary numbers, the
  158.        printer is commanded to go into "condensed" print mode.
  159.        Most dot-matrix printers have some variation of this feature.
  160.        If your printer does not have this capability, the command may
  161.        be ignored, in which case the text lines would be truncated
  162.        (unless, of course, you have a wide carriage with suitable
  163.        forms in place).
  164.  
  165.        The printer you use may be connected either in parallel or
  166.        serially, since hp simply sends outputs to the PRT: device,
  167.        which then forwards the data to the appropriate printer-
  168.        specific device driver.
  169.  
  170.  VII.  Store and Recall of data.
  171.  
  172.        hp provides 32 registers in which data may be stored.  Sixteen
  173.        of these are used for integers and sixteen are used for floats.
  174.        Each set of registers is numbered 0 through F.  To store a
  175.        number, select STO.  The underscore prompt will appear:  STO _.
  176.        At this point, select a digit key from 0 through F.  (Similarly
  177.        for RCL)  The register written to will depend on the arithmetic
  178.        mode:  integer or float.  For example, if you store the floating
  179.        point number pi in register 5 and then switch to octal and
  180.        recall register 5, you will see the last number stored in integer
  181.        register 5-- not pi.  But when you return to float (or complex)
  182.        mode, recalling register 5 will display pi once again.
  183.  
  184. VIII.  Complex numbers.
  185.  
  186.        Many functions defined for complex numbers are multiple-valued
  187.        (i.e., are not really functions at all).  An example of such
  188.        a function is the logarithm.  For real numbers, it is possible
  189.        to take logarithms only at positive values.  But for complex
  190.        numbers, any number other than zero has a logarithm.  In fact,
  191.        each such number has infinitely many logarithm values.  A
  192.        familiar analogy to this would be the real-valued arcsine curve.
  193.        Arcsine becomes a true function only when we specify which one
  194.        of infinitely many values it is to assume.  (The domain for
  195.        arcsine is normally taken as [-pi/2, pi/2] .)  Thus, when one
  196.        of the logarithms is selected (log, lg2 or ln) while in complex
  197.        mode, hp will display a "principal value" of the function.
  198.  
  199.        For a discussion of complex numbers and a derivation of the
  200.        algorithms used by hp, see (for example)  Complex Variables and
  201.        Applications, by Churchill, Brown and Verhey.  If you are
  202.        interested in how complex functions map one region of the plane
  203.        into another, see Dictionary of Conformal Representations, by
  204.        H. Kober (1957, Dover Publications).  This latter book is
  205.        thoroughly illustrated and is highly recommended for anyone with
  206.        an interest in complex numbers.
  207.  
  208.   IX.  Program note.
  209.  
  210.        hp is intended solely for free distribution as public domain
  211.        software, and is not to be sold.  If you like hp, please give
  212.        a copy to a friend.
  213.  
  214.        
  215.  
  216.  
  217.  
  218.