]> code.delx.au - gnu-emacs/blobdiff - doc/misc/calc.texi
consistently use @insertcopying, @direntry, @contents
[gnu-emacs] / doc / misc / calc.texi
index 38922746f326c78e368d12da8ef2266ea85d1575..823dccfe136a793da0d20ca4528d9461e4536b9b 100644 (file)
@@ -93,11 +93,11 @@ This file documents Calc, the GNU Emacs calculator, included with GNU Emacs 23.1
 @end ifnotinfo
 
 Copyright @copyright{} 1990, 1991, 2001, 2002, 2003, 2004,
-2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2 or
+under the terms of the GNU Free Documentation License, Version 1.3 or
 any later version published by the Free Software Foundation; with the
 Invariant Sections being just ``GNU GENERAL PUBLIC LICENSE'', with the
 Front-Cover texts being ``A GNU Manual,'' and with the Back-Cover
@@ -127,8 +127,6 @@ developing GNU and promoting software freedom.''
 @page
 
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1990, 1991, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 @insertcopying
 @end titlepage
 
@@ -161,6 +159,8 @@ file), type @kbd{?}.  (You can also type @kbd{h} to run through a
 longer Info tutorial.)
 @end ifinfo
 
+@insertcopying
+
 @menu
 * Getting Started::       General description and overview.
 @ifinfo
@@ -286,13 +286,13 @@ but Calc has the advantages of convenience, portability, and freedom.
 
 @noindent
 This document serves as a complete description of the GNU Emacs
-Calculator.  It works both as an introduction for novices, and as
+Calculator.  It works both as an introduction for novices and as
 a reference for experienced users.  While it helps to have some
 experience with GNU Emacs in order to get the most out of Calc,
 this manual ought to be readable even if you don't know or use Emacs
 regularly.
 
-The manual is divided into three major parts:@: the ``Getting
+This manual is divided into three major parts:@: the ``Getting
 Started'' chapter you are reading now, the Calc tutorial (chapter 2),
 and the Calc reference manual (the remaining chapters and appendices).
 @c [when-split]
@@ -330,14 +330,15 @@ variables also have their own indices.
 @c in the margin with its index entry.
 
 @c [fix-ref Help Commands]
-You can access this manual on-line at any time within Calc by
-pressing the @kbd{h i} key sequence.  Outside of the Calc window,
-you can press @kbd{C-x * i} to read the manual on-line.  Also, you
-can jump directly to the Tutorial by pressing @kbd{h t} or @kbd{C-x * t},
-or to the Summary by pressing @kbd{h s} or @kbd{C-x * s}.  Within Calc,
-you can also go to the part of the manual describing any Calc key,
-function, or variable using @w{@kbd{h k}}, @kbd{h f}, or @kbd{h v},
-respectively.  @xref{Help Commands}.
+You can access this manual on-line at any time within Calc by pressing
+the @kbd{h i} key sequence.  Outside of the Calc window, you can press
+@kbd{C-x * i} to read the manual on-line.  From within Calc the command
+@kbd{h t} will jump directly to the Tutorial; from outside of Calc the
+command @kbd{C-x * t} will jump to the Tutorial and start Calc if
+necessary.  Pressing @kbd{h s} or @kbd{C-x * s} will take you directly
+to the Calc Summary.  Within Calc, you can also go to the part of the
+manual describing any Calc key, function, or variable using 
+@w{@kbd{h k}}, @kbd{h f}, or @kbd{h v}, respectively.  @xref{Help Commands}.
 
 @ifnottex
 The Calc manual can be printed, but because the manual is so large, you
@@ -548,7 +549,7 @@ many weeks have passed since then.
 or equations involving variables.  Type @kbd{@w{' [x + y} = a, x y = 1] @key{RET}}
 to enter a pair of equations involving three variables.
 (Note the leading apostrophe in this example; also, note that the space
-between @samp{x y} is required.)  Type @w{@kbd{a S x,y @key{RET}}} to solve
+in @samp{x y} is required.)  Type @w{@kbd{a S x,y @key{RET}}} to solve
 these equations for the variables @expr{x} and @expr{y}.
 
 @noindent
@@ -560,7 +561,7 @@ system.  Type @kbd{d N} to return to normal notation.
 
 @noindent
 Type @kbd{7.5}, then @kbd{s l a @key{RET}} to let @expr{a = 7.5} in these formulas.
-(That's a letter @kbd{l}, not a numeral @kbd{1}.)
+(That's the letter @kbd{l}, not the numeral @kbd{1}.)
 
 @ifnotinfo
 @strong{Help functions.}  You can read about any command in the on-line
@@ -717,9 +718,11 @@ normal partial-screen mode.
 
 Finally, @kbd{C-x * o} (@code{calc-other-window}) is like @kbd{C-x * c}
 except that the Calc window is not selected.  The buffer you were
-editing before remains selected instead.  @kbd{C-x * o} is a handy
-way to switch out of Calc momentarily to edit your file; type
-@kbd{C-x * c} to switch back into Calc when you are done.
+editing before remains selected instead.  If you are in a Calc window,
+then @kbd{C-x * o} will switch you out of it, being careful not to
+switch you to the Calc Trail window.  So @kbd{C-x * o} is a handy
+way to switch out of Calc momentarily to edit your file; you can then
+type @kbd{C-x * c} to switch back into Calc when you are done.
 
 @node Quick Mode Overview, Keypad Mode Overview, The Standard Interface, Using Calc
 @subsection Quick Mode (Overview)
@@ -871,7 +874,8 @@ is
 and you wish to have Calc compute and format the derivative for
 you and store this derivative in the buffer automatically.  To
 do this with Embedded mode, first copy the formula down to where
-you want the result to be:
+you want the result to be, leaving a blank line before and after the
+formula:
 
 @smallexample
 @group
@@ -886,15 +890,16 @@ is
 @end smallexample
 
 Now, move the cursor onto this new formula and press @kbd{C-x * e}.
-Calc will read the formula (using the surrounding blank lines to
-tell how much text to read), then push this formula (invisibly)
-onto the Calc stack.  The cursor will stay on the formula in the
-editing buffer, but the buffer's mode line will change to look
-like the Calc mode line (with mode indicators like @samp{12 Deg}
-and so on).  Even though you are still in your editing buffer,
-the keyboard now acts like the Calc keyboard, and any new result
-you get is copied from the stack back into the buffer.  To take
-the derivative, you would type @kbd{a d x @key{RET}}.
+Calc will read the formula (using the surrounding blank lines to tell
+how much text to read), then push this formula (invisibly) onto the Calc
+stack.  The cursor will stay on the formula in the editing buffer, but
+the line with the formula will now appear as it would on the Calc stack
+(in this case, it will be left-aligned) and the buffer's mode line will
+change to look like the Calc mode line (with mode indicators like
+@samp{12 Deg} and so on).  Even though you are still in your editing
+buffer, the keyboard now acts like the Calc keyboard, and any new result
+you get is copied from the stack back into the buffer.  To take the
+derivative, you would type @kbd{a d x @key{RET}}.
 
 @smallexample
 @group
@@ -908,6 +913,9 @@ is
 @end group
 @end smallexample
 
+(Note that by default, Calc gives division lower precedence than multiplication,
+so that @samp{1 / ln(x) x} is equivalent to @samp{1 / (ln(x) x)}.)
+
 To make this look nicer, you might want to press @kbd{d =} to center
 the formula, and even @kbd{d B} to use Big display mode.
 
@@ -1750,9 +1758,9 @@ Calculator in Algebraic mode, which is closer to the way
 non-RPN calculators work.  In Algebraic mode, you enter formulas
 in traditional @expr{2+3} notation.
 
-@strong{Warning:} Note that @samp{/} has lower precedence than
-@samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.  See
-below for details.
+@strong{Notice:} Calc gives @samp{/} lower precedence than @samp{*}, so
+that @samp{a/b*c} is interpreted as @samp{a/(b*c)}; this is not
+standard across all computer languages.  See below for details.
 
 You don't really need any special ``mode'' to enter algebraic formulas.
 You can enter a formula at any time by pressing the apostrophe (@kbd{'})
@@ -21913,24 +21921,33 @@ formula using algebraic entry, then multiplies both sides of the
 selected quotient or equation by that formula.  It simplifies each
 side with @kbd{a s} (@code{calc-simplify}) before re-forming the
 quotient or equation.  You can suppress this simplification by
-providing any numeric prefix argument.  There is also a @kbd{j /}
+providing a prefix argument: @kbd{C-u j *}.  There is also a @kbd{j /}
 (@code{calc-sel-div-both-sides}) which is similar to @kbd{j *} but
 dividing instead of multiplying by the factor you enter.
 
-As a special feature, if the numerator of the quotient is 1, then
-the denominator is expanded at the top level using the distributive
-law (i.e., using the @kbd{C-u -1 a x} command).  Suppose the
-formula on the stack is @samp{1 / (sqrt(a) + 1)}, and you wish
-to eliminate the square root in the denominator by multiplying both
-sides by @samp{sqrt(a) - 1}.  Calc's default simplifications would
-change the result @samp{(sqrt(a) - 1) / (sqrt(a) - 1) (sqrt(a) + 1)}
-right back to the original form by cancellation; Calc expands the
-denominator to @samp{sqrt(a) (sqrt(a) - 1) + sqrt(a) - 1} to prevent
-this.  (You would now want to use an @kbd{a x} command to expand
-the rest of the way, whereupon the denominator would cancel out to
-the desired form, @samp{a - 1}.)  When the numerator is not 1, this
-initial expansion is not necessary because Calc's default
-simplifications will not notice the potential cancellation.
+If the selection is a quotient with numerator 1, then Calc's default
+simplifications would normally cancel the new factors.  To prevent
+this, when the @kbd{j *} command is used on a selection whose numerator is
+1 or -1, the denominator is expanded at the top level using the
+distributive law (as if using the @kbd{C-u 1 a x} command).  Suppose the
+formula on the stack is @samp{1 / (a + 1)} and you wish to multiplying the
+top and bottom by @samp{a - 1}.  Calc's default simplifications would
+normally change the result @samp{(a - 1) /(a + 1) (a - 1)} back
+to the original form by cancellation; when @kbd{j *} is used, Calc
+expands the denominator to  @samp{a (a - 1) + a - 1} to prevent this.
+
+If you wish the @kbd{j *} command to completely expand the denominator
+of a quotient you can call it with a zero prefix: @kbd{C-u 0 j *}.  For
+example, if the formula on the stack is @samp{1 / (sqrt(a) + 1)}, you may
+wish to eliminate the square root in the denominator by multiplying
+the top and bottom by @samp{sqrt(a) - 1}.  If you did this simply by using
+a simple @kbd{j *} command, you would get 
+@samp{(sqrt(a)-1)/ (sqrt(a) (sqrt(a) - 1) + sqrt(a) - 1)}.  Instead,
+you would probably want to use @kbd{C-u 0 j *}, which would expand the
+bottom and give you the desired result @samp{(sqrt(a)-1)/(a-1)}.  More
+generally, if @kbd{j *} is called with an argument of a positive
+integer @var{n}, then the denominator of the expression will be
+expanded @var{n} times (as if with the @kbd{C-u @var{n} a x} command).
 
 If the selection is an inequality, @kbd{j *} and @kbd{j /} will
 accept any factor, but will warn unless they can prove the factor