home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast2.iso
/
calculat
/
keypad10.zip
/
KEYPAD.DOC
next >
Wrap
Text File
|
1992-03-31
|
11KB
|
283 lines
KEYPAD10.ZIP DOCUMENTATION
INTRODUCTION:
KeyPad is an RPN (Reverse Polish Notation) scientific calculator. Once
the program is run it remains resident in memory and can be re-activated at
(almost) any time. The correct program to use depends on your computers
configuration:
KEYPADA.EXE no coprocesser installed
KEYPADB.EXE coprocesser installed
Rename whichever of these programs is correct for your system to
KEYPAD.EXE and place this new file somewhere on the DOS path. Then type KEYPAD
at the DOS prompt. When you want to use the calculator press the Num Lock key.
Pressing this key again deactivates the calculator. The current state of the
calculator is retained, as long as you don't re-boot, and will reappear when
the program is reactivated. The calculator screen can be moved on the text
screen using the arrow keys. This screen can also be moved with the Home, PgUp,
PgDn, and End keys. Additional functions are available by pressing the Ins and
Del keys. If you cannot access these keys with the Num Lock key depressed, use
I,J,K and M for arrow keys and A,S,W and Z for the Home, End, PgUp and PgDn.
Ins and Del are replaced with [ and ] respectively.
USING AN RPN CALCULATOR:
This section contains a brief introduction to using an RPN calculator.
In order to perform calculations on two numbers, both numbers must be
entered into the calculator before the operation key is pressed. For instance,
to add 4 and 5 one would type:
4 <enter> 5 +
Pressing the enter key after the 4 saves that number in an internal
register. The plus after the 5 tells the machine to add the saved number to
the 5 in the display. Similarly one can subtract, multiply and divide:
4 <enter> 5 - produces 4 - 5
4 <enter> 5 * produces 4 * 5
4 <enter> 5 / produces 4 / 5
Any calculation that only requires one number always operates on the
display. For instance to take the sine of 90 degrees one would type:
90 SIN
For information on accessing the SIN key, and other functions, see the
section on KeyPad features below.
All calculations are saved on a four number internal stack. Whenever the
<enter> key is pressed the stack is 'pushed', and any function key operates on
the top one or two elements of the stack. In practice this means that one never
needs parentheses, and rarely needs to save intermediate calculations.
Suppose you want to compute (4+5)*(6-2). A possible series of key-strokes,
and a picture of the stack, is shown below:
Initial Stack: (display is at top)
0.0
0.0
0.0
0.0
4 <enter> 5
5.0
4.0
0.0
0.0
+
9.0
0.0
0.0
0.0
6 <enter> 2
2.0
6.0
9.0 Notice the 9.0 was 'pushed' when the 6 was
0.0 typed
-
4.0
9.0
0.0
0.0
*
36.0
0.0
0.0
0.0
Whenever the stack is 'popped' the bottom element is moved into the next
higher position in the stack. For instance if the stack contains
4.0
3.0
2.0
1.0
then typing the * key will produce
12.0
2.0
1.0
1.0
KEYPAD FEATURES:
When KeyPad is initially activated one sees the following :
╔═══════════════════╗
║╔═════════════════╗║
║║0.0000 ║║
║╚═════════════════╝║
║ ╔═══╦═══╦═══╦═══╗ ║
║ ║OFF║ / ║ * ║ - ║ ║
║ ╠═══╬═══╬═══╬═══╣ ║
║ ║ 7 ║ 8 ║ 9 ║ ║ ║
║ ╠═══╬═══╬═══╣ + ║ ║
║ ║ 4 ║ 5 ║ 6 ║ ║ ║
║ ╠═══╬═══╬═══╬═══╣ ║
║ ║ 1 ║ 2 ║ 3 ║ E ║ ║
║ ╠═══╩═══╬═══╣ N ║ ║
║ ║ 0 ║ . ║ T ║ ║
║ ╚═══════╩═══╩═══╝ ║
╚═══════════════════╝
This screen allows one to enter numbers in the stack and to operate on them
with the four basic arithmetic operations. Pressing the Ins (or [) key produces
the screen:
╔═══════════════════╗
║╔═════════════════╗║
║║0.0000 ║║
║╚═════════════════╝║
║ ╔═══╦═══╦═══╦═══╗ ║
║ ║OFF║CLX║X|Y║FIX║ ║
║ ╠═══╬═══╬═══╬═══╣ ║
║ ║EEX║CHS║ π ║ D ║ ║
║ ╠═══╬═══╬═══╣ E ║ ║
║ ║ D ║ E ║ F ║ C ║ ║
║ ╠═══╬═══╬═══╬═══╣ ║
║ ║ A ║ B ║ C ║ R ║ ║
║ ╠═══╩═══╬═══╣ A ║ ║
║ ║ ROLL ║X^2║ D ║ ║
║ ╚═══════╩═══╩═══╝ ║
╚═══════════════════╝
The meaning of each of these keys is explained below.
CLX ( / key) : Clear the display
X|Y ( * key) : Interchange the top two elements of the stack
FIX ( - key) : Set the precision. After this key is pressed the
display will revert to the original. Type a number
between 0 and 9 to set the number of digits of
precision after the decimal point that will be
displayed. This number does not affect the precision
with which calculations are carried out.
DEC ( + key) : Set the radix. When this key is typed the base for
calculations is changed to 16. The key will then read
HEX. Typing it again reverts to base ten.
RAD (<enter> key) : Set the angle type. When this key is typed the machine
assumes all angles are measured in degrees. The key
will then read DEG. Typing it again reverts to radian
measure. This key only affects the operation of the
trigonometric functions.
EEX ( 7 key) : Enter an exponent. After this key is typed enter a one
or two digit exponent. The sign of the exponent may be
changed with the CHS key. When the exponent is entered
type the EEX key again.
CHS ( 8 key) : Change the sign of the display.
π ( 9 key) : Enter pi (~3.141592654) into the display.
A-F ( 1 - 6 keys) : Enter the hexadecimal digits a through f into the
display. These keys only work when the base is set to
sixteen.
ROLL ( 0 key) : Roll the stack. The display is taken to the bottom of
the stack, and the other elements are popped up one
place.
X^2 ( . key) : The display is squared.
When the Del (or ]) key is pressed the screen changes to:
╔═══════════════════╗
║╔═════════════════╗║
║║0.0000 ║║
║╚═════════════════╝║
║ ╔═══╦═══╦═══╦═══╗ ║
║ ║OFF║1/X║Y^X║e^X║ ║
║ ╠═══╬═══╬═══╬═══╣ ║
║ ║SIN║COS║TAN║ L ║ ║
║ ╠═══╬═══╬═══╣ N ║ ║
║ ║ASN║ACS║ATN║ X ║ ║
║ ╠═══╬═══╬═══╬═══╣ ║
║ ║STO║RCL║LST║ L ║ ║
║ ╠═══╩═══╬═══╣ O ║ ║
║ ║ 10^X ║√X ║ G ║ ║
║ ╚═══════╩═══╩═══╝ ║
╚═══════════════════╝
The meaning of each of these keys is explained below.
1/X ( / key) : Compute the reciprocal of the display.
Y^X ( * key) : Take the second element of the stack to the power shown
in the display.
e^X ( - key) : Raise the constant e (~2.71828) to the power shown in
the display.
LNX ( + key) : Compute the natural logarithm of the display.
LOG (<enter> key) : Compute the logarithm base ten of the display.
SIN ( 7 key) : Compute the sine of the display.
COS ( 8 key) : Compute the cosine of the display.
TAN ( 9 key) : Compute the tangent of the display.
ASN ( 4 key) : Compute the arcsine of the display.
ACS ( 5 key) : Compute the arccosine of the display.
ATN ( 6 key) : Compute the arctangent of the display.
STO ( 1 key) : Store the display. After typing this key type a single
decimal digit. The display will be stored in one of ten
internal registers, determined by the digit typed.
RCL ( 2 key) : Recall. After typing this key type a single decimal
digit. The internal register named by that digit will
be recalled to the display.
LST ( 3 key) : Last X. This key restores the value the display had
when the last function key was pressed.
10^X ( 0 key) : Raise 10 to the power shown in the display.
√X ( . key) : Compute the square root of the display.
ERROR MESSAGES:
KeyPad produces one of six error messages. Their meanings are as follows:
Improper Argument : A function key has been pressed with invalid operands
on the stack, for instance by trying to compute ln(-1).
Singularity : Similar to the error above. Log(0) will produce this
message.
Overflow : The computed number is too large or too small.
Underflow : The number computed has too small a negative
exponent. Usually zero can be substituted for the
result.
No Significance : The number as computed by the machine is meaningless.
For instance sin(10e95) will produce this error.
Exception n : Here n is a one or two digit number. This error
should not occur. I would be interested in knowing the
circumstances that produced it if it does.
After an error message type any key, other than Shift, Alt or Ctrl,
to clear the message from the display.
BUGS:
Error messages can sometimes lose a number from the stack.