home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
gnu
/
info
/
calc.info-2
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-12-22
|
40KB
|
685 lines
This is Info file calc.info, produced by Makeinfo-1.55 from the input
file calc.texinfo.
This file documents Calc, the GNU Emacs calculator.
Copyright (C) 1990, 1991 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the section entitled "GNU General Public License" is included
exactly as in the original, and provided that the entire resulting
derived work is distributed under the terms of a permission notice
identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the section entitled "GNU General Public License"
may be included in a translation approved by the author instead of in
the original English.
File: calc.info, Node: History and Acknowledgements, Prev: Using Calc, Up: Getting Started
History and Acknowledgements
============================
Calc was originally started as a two-week project to occupy a lull in
the author's schedule. Basically, a friend asked if I remembered the
value of `2^32'. I didn't offhand, but I said, "that's easy, just call
up an `xcalc'." `Xcalc' duly reported that the answer to our question
was `4.294967e+09'--with no way to see the full ten digits even though
we knew they were there in the program's memory! I was so annoyed, I
vowed to write a calculator of my own, once and for all.
I chose Emacs Lisp, a) because I had always been curious about it
and b) because, being only a text editor extension language after all,
Emacs Lisp would surely reach its limits long before the project got
too far out of hand.
To make a long story short, Emacs Lisp turned out to be a
distressingly solid implementation of Lisp, and the humble task of
calculating turned out to be more open-ended than one might have
expected.
Emacs Lisp doesn't have built-in floating point math, so it had to be
simulated in software. In fact, Emacs integers will only comfortably
fit six decimal digits or so--not enough for a decent calculator. So I
had to write my own high-precision integer code as well, and once I had
this I figured that arbitrary-size integers were just as easy as large
integers. Arbitrary floating-point precision was the logical next step.
Also, since the large integer arithmetic was there anyway it seemed only
fair to give the user direct access to it, which in turn made it
practical to support fractions as well as floats. All these features
inspired me to look around for other data types that might be worth
having.
Around this time, my friend Rick Koshi showed me his nifty new HP-28
calculator. It allowed the user to manipulate formulas as well as
numerical quantities, and it could also operate on matrices. I decided
that these would be good for Calc to have, too. And once things had
gone this far, I figured I might as well take a look at serious algebra
systems like Mathematica, Macsyma, and Maple for further ideas. Since
these systems did far more than I could ever hope to implement, I
decided to focus on rewrite rules and other programming features so
that users could implement what they needed for themselves.
Rick complained that matrices were hard to read, so I put in code to
format them in a 2D style. Once these routines were in place, Big mode
was obligatory. Gee, what other language modes would be useful?
Scott Hemphill and Allen Knutson, two friends with a strong
mathematical bent, contributed ideas and algorithms for a number of
Calc features including modulo forms, primality testing, and
float-to-fraction conversion.
Units were added at the eager insistence of Mass Sivilotti. Later,
Ulrich Mueller at CERN and Przemek Klosowski at NIST provided invaluable
expert assistance with the units table. As far as I can remember, the
idea of using algebraic formulas and variables to represent units dates
back to an ancient article in Byte magazine about muMath, an early
algebra system for microcomputers.
Many people have contributed to Calc by reporting bugs and suggesting
features, large and small. A few deserve special mention: Tim Peters,
who helped develop the ideas that led to the selection commands, rewrite
rules, and many other algebra features; Francois Pinard, who contributed
an early prototype of the Calc Summary appendix as well as providing
valuable suggestions in many other areas of Calc; Carl Witty, whose
eagle eyes discovered many typographical and factual errors in the Calc
manual; Tim Kay, who drove the development of Embedded mode; Ove
Ewerlid, who made many suggestions relating to the algebra commands and
contributed some code for polynomial operations; Randal Schwartz, who
suggested the `calc-eval' function; Robert J. Chassell, who suggested
the Calc Tutorial and exercises; and Juha Sarlin, who first worked out
how to split Calc into quickly-loading parts. Bob Weiner helped
immensely with the Lucid Emacs port.
Among the books used in the development of Calc were Knuth's *Art of
Computer Programming* (especially volume II, *Seminumerical
Algorithms*); *Numerical Recipes* by Press, Flannery, Teukolsky, and
Vetterling; Bevington's *Data Reduction and Error Analysis for the
Physical Sciences*; *Concrete Mathematics* by Graham, Knuth, and
Patashnik; Steele's *Common Lisp, the Language*; the *CRC Standard Math
Tables* (William H. Beyer, ed.); and Abramowitz and Stegun's venerable
*Handbook of Mathematical Functions*. I consulted the user's manuals
for the HP-28 and HP-48 calculators, as well as for the programs
Mathematica, SMP, Macsyma, Maple, MathCAD, Gnuplot, and others. Also,
of course, Calc could not have been written without the excellent *GNU
Emacs Lisp Reference Manual*, by Bil Lewis and Dan LaLiberte.
Final thanks go to Richard Stallman, without whose fine
implementations of the Emacs editor, language, and environment, Calc
would have been finished in two weeks.
File: calc.info, Node: Interactive Tutorial, Up: Top
Tutorial
********
Some brief instructions on using the Emacs Info system for this
tutorial:
Press the space bar and Delete keys to go forward and backward in a
section by screenfuls (or use the regular Emacs scrolling commands for
this).
Press `n' or `p' to go to the Next or Previous section. If the
section has a "menu", press a digit key like `1' or `2' to go to a
sub-section from the menu. Press `u' to go back up from a sub-section
to the menu it is part of.
Exercises in the tutorial all have cross-references to the
appropriate page of the "answers" section. Press `f', then the
exercise number, to see the answer to an exercise. After you have
followed a cross-reference, you can press the letter `l' to return to
where you were before.
You can press `?' at any time for a brief summary of Info commands.
Press `1' now to enter the first section of the Tutorial.
* Menu:
* Tutorial::
File: calc.info, Node: Tutorial, Next: Introduction, Prev: Getting Started, Up: Top
Tutorial
********
This chapter explains how to use Calc and its many features, in a
step-by-step, tutorial way. You are encouraged to run Calc and work
along with the examples as you read (*note Starting Calc::.). If you
are already familiar with advanced calculators, you may wish to skip on
to the rest of this manual.
This tutorial describes the standard user interface of Calc only.
The "Quick Mode" and "Keypad Mode" interfaces are fairly
self-explanatory. *Note Embedded Mode::, for a description of the
"Embedded Mode" interface.
The easiest way to read this tutorial on-line is to have two windows
on your Emacs screen, one with Calc and one with the Info system. (If
you have a printed copy of the manual you can use that instead.) Press
`M-# c' to turn Calc on or to switch into the Calc window, and press
`M-# i' to start the Info system or to switch into its window. Or, you
may prefer to use the tutorial in printed form.
This