home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
- DOCUMENTATION FOR CALC87.C
- Dan Schechter
- Route 1 Box 19
- Amenia, North Dakota 58004
- (701) 967-8371
-
- This is just a little nick-knack of a program that I threw
- together when I read in the Ecosoft documentation that their floating
- point math was implemented as a software emulation of the 8087 math
- chip. I have always wished that my CP/M Kaypro could be fitted out
- with a math chip. Of course "software emulation" lacks the speed
- advantage of a dedicated chip. But nevertheless I was moved to write
- this little "calculator" program. It is not resident. It does not pop
- up like the fancy commercial programs. But it should give exactly the
- same answers as the 8087 IF (and I stress IF) it is compiled with the
- Eco-C88, or some other compiler that emulates the 8087. (Or if you
- actually have an 8087, of course!).
- This program works more or less like a very cheap calculator. It
- has addition, subtraction, multiplication, and division. It has sin,
- cos, tan, arcsin, arccos, arctan. It will do squares and square roots.
- It will take reciprocals. It will raise one number to the power of
- another. And it has ten memories.
- It does not recognize parentheses. You must do your calculations
- one at a time. However you can use the memories to hold intermediate
- results.
- To find roots (other than square root, which is directly
- supported) use the reciprocal. Example:
- To find the 35th root of 987, first take the reciprocal of 35 and
- put it in a memory. Then raise 987 to the power of that stored
- reciprocal. This works with fractional numbers as well.
- It should be simple to extend this program to include whatever
- functions you find useful or interesting.
- This program is not intended to be anything but a toy. Do
- whatever you like with it.
- Please note that it distinguishes between upper and lower case on
- the inputs.
- With minor changes it compiles and runs under Aztec C II for
- CP/M. (Though it then does not give the same accuracy.)
- oy. Do
- whatever you like with it.