aboutsummaryrefslogtreecommitdiffstats
path: root/man
diff options
context:
space:
mode:
authorKaroly Lorentey2004-12-23 16:43:51 +0000
committerKaroly Lorentey2004-12-23 16:43:51 +0000
commit17d51b68fb4e7da4f18eff72c589b7ffc4f9c22c (patch)
treef490c1ccdbd43077ea77f953bc59ca94c2fe810c /man
parent4b89585ee70a1f64543a5851f07cf7e2d89c5c62 (diff)
parent55f4edbcd246d8ea1715687a7aeeb3afe35c0345 (diff)
downloademacs-17d51b68fb4e7da4f18eff72c589b7ffc4f9c22c.tar.gz
emacs-17d51b68fb4e7da4f18eff72c589b7ffc4f9c22c.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-726 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-727 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-728 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-729 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-730 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-731 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-732 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-733 Update from CVS: man/calc.texi: Fix some TeX definitions. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-734 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-735 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-736 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-737 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-738 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-739 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-740 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-741 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-742 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-743 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-744 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-745 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-746 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-75 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-76 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-77 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-277
Diffstat (limited to 'man')
-rw-r--r--man/ChangeLog66
-rw-r--r--man/calc.texi1202
-rw-r--r--man/cc-mode.texi4
-rw-r--r--man/dired.texi4
-rw-r--r--man/gnus-faq.texi2
-rw-r--r--man/mark.texi13
-rw-r--r--man/misc.texi28
-rw-r--r--man/trampver.texi2
-rw-r--r--man/url.texi94
9 files changed, 744 insertions, 671 deletions
diff --git a/man/ChangeLog b/man/ChangeLog
index 9672a0c2437..3b6507e6b78 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,57 @@
12004-12-20 Jay Belanger <belanger@truman.edu>
2
3 * calc.texi (Types Tutorial): Emphasized that you can't divide by
4 zero.
5
62004-12-17 Luc Teirlinck <teirllm@auburn.edu>
7
8 * cc-mode.texi (Text Filling and Line Breaking): Put period after
9 @xref.
10 (Font Locking): Avoid @strong{Note:}.
11
122004-12-17 Michael Albinus <michael.albinus@gmx.de>
13
14 Sync with Tramp 2.0.46.
15
16 * tramp.texi (bottom): Add arch-tag. It was lost, somehow.
17
182004-12-16 Luc Teirlinck <teirllm@auburn.edu>
19
20 * url.texi: Correct typos.
21 (Retrieving URLs): @var{nil}->@code{nil}.
22 (HTTP language/coding, mailto): Replace "GNU Emacs Manual" with
23 the standard "The GNU Emacs Manual" in fifth argument of @xref's.
24 (Dealing with HTTP documents): @inforef->@xref.
25
262004-12-15 Juri Linkov <juri@jurta.org>
27
28 * mark.texi (Transient Mark, Mark Ring): M-< and other
29 movement commands don't set mark in Transient Mark mode
30 if mark is active.
31
322004-12-15 Jay Belanger <belanger@truman.edu>
33
34 * calc.texi: Consistently capitalized all mode names.
35 (Answers to Exercises): Mention that an answer can be a fraction
36 when in Fraction mode.
37
382004-12-13 Jay Belanger <belanger@truman.edu>
39
40 * calc.texi: Fix some TeX definitions.
41
422004-12-12 Juri Linkov <juri@jurta.org>
43
44 * misc.texi (FFAP): Add C-x C-r, C-x C-v, C-x C-d,
45 C-x 4 r, C-x 4 d, C-x 5 r, C-x 5 d.
46
47 * dired.texi (Dired Navigation): Add @r{(Dired)} to M-g.
48 (Misc Dired Commands): Add @r{(Dired)} to w.
49
502004-12-12 Juri Linkov <juri@jurta.org>
51
52 * mark.texi (Marking Objects): Marking commands also extend the
53 region when mark is active in Transient Mark mode.
54
12004-12-09 Luc Teirlinck <teirllm@auburn.edu> 552004-12-09 Luc Teirlinck <teirllm@auburn.edu>
2 56
3 * reftex.texi (Imprint): Remove erroneous @value's. 57 * reftex.texi (Imprint): Remove erroneous @value's.
@@ -133,6 +187,13 @@
133 to Alex Ott, Karl Fogel, Stefan Monnier, and David Kastrup for 187 to Alex Ott, Karl Fogel, Stefan Monnier, and David Kastrup for
134 suggestions. 188 suggestions.
135 189
1902004-12-08 Reiner Steib <Reiner.Steib@gmx.de>
191
192 * gnus-faq.texi ([5.1]): Added missing bracket.
193
194 * gnus.texi (Filtering Spam Using The Spam ELisp Package): Index
195 `spam-initialize'.
196
1362004-11-22 Reiner Steib <Reiner.Steib@gmx.de> 1972004-11-22 Reiner Steib <Reiner.Steib@gmx.de>
137 198
138 * message.texi (Various Message Variables): Mention that all mail 199 * message.texi (Various Message Variables): Mention that all mail
@@ -140,11 +201,6 @@
140 201
141 * gnus.texi (Splitting Mail): Clarify bogus group. 202 * gnus.texi (Splitting Mail): Clarify bogus group.
142 203
1432004-11-16 Reiner Steib <Reiner.Steib@gmx.de>
144
145 * gnus.texi (Filtering Spam Using The Spam ELisp Package): Index
146 `spam-initialize'.
147
1482004-11-02 Katsumi Yamaoka <yamaoka@jpl.org> 2042004-11-02 Katsumi Yamaoka <yamaoka@jpl.org>
149 205
150 * emacs-mime.texi (Encoding Customization): Fix 206 * emacs-mime.texi (Encoding Customization): Fix
diff --git a/man/calc.texi b/man/calc.texi
index 027ebc7c960..8260ed10350 100644
--- a/man/calc.texi
+++ b/man/calc.texi
@@ -13,28 +13,20 @@
13@c @infoline foo 13@c @infoline foo
14@c `foo' will appear only in non-TeX output 14@c `foo' will appear only in non-TeX output
15 15
16@c In TeX output, @tmath{expr} will typeset expr in math mode. 16@c @expr{expr} will typeset an expression;
17@c In any output, @expr{expr} will typeset an expression;
18@c $x$ in TeX, @samp{x} otherwise. 17@c $x$ in TeX, @samp{x} otherwise.
19 18
20@iftex 19@iftex
21@macro texline{stuff} 20@macro texline{stuff}
22\stuff\ 21\stuff\
23@end macro 22@end macro
24@macro tmath{stuff}
25@tex
26$\stuff\$
27@end tex
28@end macro
29@alias infoline=comment 23@alias infoline=comment
30@c @alias expr=math
31@tex 24@tex
32\gdef\expr#1{\tex 25\gdef\exprsetup{\tex \let\t\ttfont \turnoffactive}
33 \let\t\ttfont 26\gdef\expr{\exprsetup$\exprfinish}
34 \turnoffactive 27\gdef\exprfinish#1{#1$\endgroup}
35 $#1$
36 \endgroup}
37@end tex 28@end tex
29@alias mathit=expr
38@macro cpi{} 30@macro cpi{}
39@math{@pi{}} 31@math{@pi{}}
40@end macro 32@end macro
@@ -49,6 +41,7 @@ $\stuff\$
49\stuff\ 41\stuff\
50@end macro 42@end macro
51@alias expr=samp 43@alias expr=samp
44@alias mathit=i
52@macro cpi{} 45@macro cpi{}
53@expr{pi} 46@expr{pi}
54@end macro 47@end macro
@@ -470,7 +463,7 @@ Algebraic manipulation features, including symbolic calculus.
470Moving data to and from regular editing buffers. 463Moving data to and from regular editing buffers.
471 464
472@item 465@item
473``Embedded mode'' for manipulating Calc formulas and data directly 466Embedded mode for manipulating Calc formulas and data directly
474inside any editing buffer. 467inside any editing buffer.
475 468
476@item 469@item
@@ -624,12 +617,12 @@ then the command to operate on the numbers.
624 617
625@noindent 618@noindent
626Type @kbd{2 @key{RET} 3 + Q} to compute 619Type @kbd{2 @key{RET} 3 + Q} to compute
627@texline @tmath{\sqrt{2+3} = 2.2360679775}. 620@texline @math{\sqrt{2+3} = 2.2360679775}.
628@infoline the square root of 2+3, which is 2.2360679775. 621@infoline the square root of 2+3, which is 2.2360679775.
629 622
630@noindent 623@noindent
631Type @kbd{P 2 ^} to compute 624Type @kbd{P 2 ^} to compute
632@texline @tmath{\pi^2 = 9.86960440109}. 625@texline @math{\pi^2 = 9.86960440109}.
633@infoline the value of `pi' squared, 9.86960440109. 626@infoline the value of `pi' squared, 9.86960440109.
634 627
635@noindent 628@noindent
@@ -648,12 +641,12 @@ use the apostrophe key.
648 641
649@noindent 642@noindent
650Type @kbd{' sqrt(2+3) @key{RET}} to compute 643Type @kbd{' sqrt(2+3) @key{RET}} to compute
651@texline @tmath{\sqrt{2+3}}. 644@texline @math{\sqrt{2+3}}.
652@infoline the square root of 2+3. 645@infoline the square root of 2+3.
653 646
654@noindent 647@noindent
655Type @kbd{' pi^2 @key{RET}} to enter 648Type @kbd{' pi^2 @key{RET}} to enter
656@texline @tmath{\pi^2}. 649@texline @math{\pi^2}.
657@infoline `pi' squared. 650@infoline `pi' squared.
658To evaluate this symbolic formula as a number, type @kbd{=}. 651To evaluate this symbolic formula as a number, type @kbd{=}.
659 652
@@ -713,10 +706,10 @@ the lower-right @samp{8} and press @kbd{M-# r}.
713 706
714@noindent 707@noindent
715Type @kbd{v t} to transpose this 708Type @kbd{v t} to transpose this
716@texline @tmath{3\times2} 709@texline @math{3\times2}
717@infoline 3x2 710@infoline 3x2
718matrix into a 711matrix into a
719@texline @tmath{2\times3} 712@texline @math{2\times3}
720@infoline 2x3 713@infoline 2x3
721matrix. Type @w{@kbd{v u}} to unpack the rows into two separate 714matrix. Type @w{@kbd{v u}} to unpack the rows into two separate
722vectors. Now type @w{@kbd{V R + @key{TAB} V R +}} to compute the sums 715vectors. Now type @w{@kbd{V R + @key{TAB} V R +}} to compute the sums
@@ -773,7 +766,7 @@ To exit from Calc, press @kbd{q} or @kbd{M-# c} again.
773@noindent 766@noindent
774Calc has several user interfaces that are specialized for 767Calc has several user interfaces that are specialized for
775different kinds of tasks. As well as Calc's standard interface, 768different kinds of tasks. As well as Calc's standard interface,
776there are Quick Mode, Keypad Mode, and Embedded Mode. 769there are Quick mode, Keypad mode, and Embedded mode.
777 770
778@menu 771@menu
779* Starting Calc:: 772* Starting Calc::
@@ -808,7 +801,7 @@ doesn't matter for @kbd{M-#}) that says which Calc interface you
808want to use. 801want to use.
809 802
810To get Calc's standard interface, type @kbd{M-# c}. To get 803To get Calc's standard interface, type @kbd{M-# c}. To get
811Keypad Mode, type @kbd{M-# k}. Type @kbd{M-# ?} to get a brief 804Keypad mode, type @kbd{M-# k}. Type @kbd{M-# ?} to get a brief
812list of the available options, and type a second @kbd{?} to get 805list of the available options, and type a second @kbd{?} to get
813a complete list. 806a complete list.
814 807
@@ -821,7 +814,7 @@ function key twice is just like hitting @kbd{M-# M-#}.)
821 814
822If @kbd{M-#} doesn't work for you, you can always type explicit 815If @kbd{M-#} doesn't work for you, you can always type explicit
823commands like @kbd{M-x calc} (for the standard user interface) or 816commands like @kbd{M-x calc} (for the standard user interface) or
824@w{@kbd{M-x calc-keypad}} (for Keypad Mode). First type @kbd{M-x} 817@w{@kbd{M-x calc-keypad}} (for Keypad mode). First type @kbd{M-x}
825(that's Meta with the letter @kbd{x}), then, at the prompt, 818(that's Meta with the letter @kbd{x}), then, at the prompt,
826type the full command (like @kbd{calc-keypad}) and press Return. 819type the full command (like @kbd{calc-keypad}) and press Return.
827 820
@@ -867,9 +860,9 @@ you do.
867 860
868In this case, the trail shows that four numbers (17.3, 3, 2, and 4) 861In this case, the trail shows that four numbers (17.3, 3, 2, and 4)
869were first entered into the Calculator, then the 2 and 4 were 862were first entered into the Calculator, then the 2 and 4 were
870multiplied to get 8, then the 3 and 8 were subtracted to get @i{-5}. 863multiplied to get 8, then the 3 and 8 were subtracted to get @mathit{-5}.
871(The @samp{>} symbol shows that this was the most recent calculation.) 864(The @samp{>} symbol shows that this was the most recent calculation.)
872The net result is the two numbers 17.3 and @i{-5} sitting on the stack. 865The net result is the two numbers 17.3 and @mathit{-5} sitting on the stack.
873 866
874Most Calculator commands deal explicitly with the stack only, but 867Most Calculator commands deal explicitly with the stack only, but
875there is a set of commands that allow you to search back through 868there is a set of commands that allow you to search back through
@@ -924,20 +917,20 @@ way to switch out of Calc momentarily to edit your file; type
924@subsection Quick Mode (Overview) 917@subsection Quick Mode (Overview)
925 918
926@noindent 919@noindent
927@dfn{Quick Mode} is a quick way to use Calc when you don't need the 920@dfn{Quick mode} is a quick way to use Calc when you don't need the
928full complexity of the stack and trail. To use it, type @kbd{M-# q} 921full complexity of the stack and trail. To use it, type @kbd{M-# q}
929(@code{quick-calc}) in any regular editing buffer. 922(@code{quick-calc}) in any regular editing buffer.
930 923
931Quick Mode is very simple: It prompts you to type any formula in 924Quick mode is very simple: It prompts you to type any formula in
932standard algebraic notation (like @samp{4 - 2/3}) and then displays 925standard algebraic notation (like @samp{4 - 2/3}) and then displays
933the result at the bottom of the Emacs screen (@i{3.33333333333} 926the result at the bottom of the Emacs screen (@mathit{3.33333333333}
934in this case). You are then back in the same editing buffer you 927in this case). You are then back in the same editing buffer you
935were in before, ready to continue editing or to type @kbd{M-# q} 928were in before, ready to continue editing or to type @kbd{M-# q}
936again to do another quick calculation. The result of the calculation 929again to do another quick calculation. The result of the calculation
937will also be in the Emacs ``kill ring'' so that a @kbd{C-y} command 930will also be in the Emacs ``kill ring'' so that a @kbd{C-y} command
938at this point will yank the result into your editing buffer. 931at this point will yank the result into your editing buffer.
939 932
940Calc mode settings affect Quick Mode, too, though you will have to 933Calc mode settings affect Quick mode, too, though you will have to
941go into regular Calc (with @kbd{M-# c}) to change the mode settings. 934go into regular Calc (with @kbd{M-# c}) to change the mode settings.
942 935
943@c [fix-ref Quick Calculator mode] 936@c [fix-ref Quick Calculator mode]
@@ -947,12 +940,12 @@ go into regular Calc (with @kbd{M-# c}) to change the mode settings.
947@subsection Keypad Mode (Overview) 940@subsection Keypad Mode (Overview)
948 941
949@noindent 942@noindent
950@dfn{Keypad Mode} is a mouse-based interface to the Calculator. 943@dfn{Keypad mode} is a mouse-based interface to the Calculator.
951It is designed for use with terminals that support a mouse. If you 944It is designed for use with terminals that support a mouse. If you
952don't have a mouse, you will have to operate keypad mode with your 945don't have a mouse, you will have to operate Keypad mode with your
953arrow keys (which is probably more trouble than it's worth). 946arrow keys (which is probably more trouble than it's worth).
954 947
955Type @kbd{M-# k} to turn Keypad Mode on or off. Once again you 948Type @kbd{M-# k} to turn Keypad mode on or off. Once again you
956get two new windows, this time on the righthand side of the screen 949get two new windows, this time on the righthand side of the screen
957instead of at the bottom. The upper window is the familiar Calc 950instead of at the bottom. The upper window is the familiar Calc
958Stack; the lower window is a picture of a typical calculator keypad. 951Stack; the lower window is a picture of a typical calculator keypad.
@@ -988,12 +981,12 @@ Stack; the lower window is a picture of a typical calculator keypad.
988 |-----+-----+-----+-----+-----+ 981 |-----+-----+-----+-----+-----+
989@end smallexample 982@end smallexample
990 983
991Keypad Mode is much easier for beginners to learn, because there 984Keypad mode is much easier for beginners to learn, because there
992is no need to memorize lots of obscure key sequences. But not all 985is no need to memorize lots of obscure key sequences. But not all
993commands in regular Calc are available on the Keypad. You can 986commands in regular Calc are available on the Keypad. You can
994always switch the cursor into the Calc stack window to use 987always switch the cursor into the Calc stack window to use
995standard Calc commands if you need. Serious Calc users, though, 988standard Calc commands if you need. Serious Calc users, though,
996often find they prefer the standard interface over Keypad Mode. 989often find they prefer the standard interface over Keypad mode.
997 990
998To operate the Calculator, just click on the ``buttons'' of the 991To operate the Calculator, just click on the ``buttons'' of the
999keypad using your left mouse button. To enter the two numbers 992keypad using your left mouse button. To enter the two numbers
@@ -1006,13 +999,13 @@ keypad change to show other sets of commands, such as advanced
1006math functions, vector operations, and operations on binary 999math functions, vector operations, and operations on binary
1007numbers. 1000numbers.
1008 1001
1009Because Keypad Mode doesn't use the regular keyboard, Calc leaves 1002Because Keypad mode doesn't use the regular keyboard, Calc leaves
1010the cursor in your original editing buffer. You can type in 1003the cursor in your original editing buffer. You can type in
1011this buffer in the usual way while also clicking on the Calculator 1004this buffer in the usual way while also clicking on the Calculator
1012keypad. One advantage of Keypad Mode is that you don't need an 1005keypad. One advantage of Keypad mode is that you don't need an
1013explicit command to switch between editing and calculating. 1006explicit command to switch between editing and calculating.
1014 1007
1015If you press @kbd{M-# b} first, you get a full-screen Keypad Mode 1008If you press @kbd{M-# b} first, you get a full-screen Keypad mode
1016(@code{full-calc-keypad}) with three windows: The keypad in the lower 1009(@code{full-calc-keypad}) with three windows: The keypad in the lower
1017left, the stack in the lower right, and the trail on top. 1010left, the stack in the lower right, and the trail on top.
1018 1011
@@ -1050,7 +1043,7 @@ itself.
1050@subsection Embedded Mode (Overview) 1043@subsection Embedded Mode (Overview)
1051 1044
1052@noindent 1045@noindent
1053@dfn{Embedded Mode} is a way to use Calc directly from inside an 1046@dfn{Embedded mode} is a way to use Calc directly from inside an
1054editing buffer. Suppose you have a formula written as part of a 1047editing buffer. Suppose you have a formula written as part of a
1055document like this: 1048document like this:
1056 1049
@@ -1067,7 +1060,7 @@ is
1067@noindent 1060@noindent
1068and you wish to have Calc compute and format the derivative for 1061and you wish to have Calc compute and format the derivative for
1069you and store this derivative in the buffer automatically. To 1062you and store this derivative in the buffer automatically. To
1070do this with Embedded Mode, first copy the formula down to where 1063do this with Embedded mode, first copy the formula down to where
1071you want the result to be: 1064you want the result to be:
1072 1065
1073@smallexample 1066@smallexample
@@ -1106,7 +1099,7 @@ is
1106@end smallexample 1099@end smallexample
1107 1100
1108To make this look nicer, you might want to press @kbd{d =} to center 1101To make this look nicer, you might want to press @kbd{d =} to center
1109the formula, and even @kbd{d B} to use ``big'' display mode. 1102the formula, and even @kbd{d B} to use Big display mode.
1110 1103
1111@smallexample 1104@smallexample
1112@group 1105@group
@@ -1146,7 +1139,7 @@ righthand label: Type @kbd{d @} (1) @key{RET}}.
1146@end group 1139@end group
1147@end smallexample 1140@end smallexample
1148 1141
1149To leave Embedded Mode, type @kbd{M-# e} again. The mode line 1142To leave Embedded mode, type @kbd{M-# e} again. The mode line
1150and keyboard will revert to the way they were before. (If you have 1143and keyboard will revert to the way they were before. (If you have
1151actually been trying this as you read along, you'll want to press 1144actually been trying this as you read along, you'll want to press
1152@kbd{M-# 0} [with the digit zero] now to reset the modes you changed.) 1145@kbd{M-# 0} [with the digit zero] now to reset the modes you changed.)
@@ -1161,7 +1154,7 @@ A slope of one-third corresponds to an angle of 1 degrees.
1161@end smallexample 1154@end smallexample
1162 1155
1163Place the cursor on the @samp{1}, then type @kbd{M-# w} to enable 1156Place the cursor on the @samp{1}, then type @kbd{M-# w} to enable
1164Embedded Mode on that number. Now type @kbd{3 /} (to get one-third), 1157Embedded mode on that number. Now type @kbd{3 /} (to get one-third),
1165and @kbd{I T} (the Inverse Tangent converts a slope into an angle), 1158and @kbd{I T} (the Inverse Tangent converts a slope into an angle),
1166then @w{@kbd{M-# w}} again to exit Embedded mode. 1159then @w{@kbd{M-# w}} again to exit Embedded mode.
1167 1160
@@ -1228,7 +1221,7 @@ move it out of that window.
1228Control whether @kbd{M-# c} and @kbd{M-# k} use the full screen. 1221Control whether @kbd{M-# c} and @kbd{M-# k} use the full screen.
1229 1222
1230@item Q 1223@item Q
1231Use Quick Mode for a single short calculation. 1224Use Quick mode for a single short calculation.
1232 1225
1233@item K 1226@item K
1234Turn Calc Keypad mode on or off. 1227Turn Calc Keypad mode on or off.
@@ -1277,7 +1270,7 @@ Yank a value from the Calculator into the current editing buffer.
1277@end iftex 1270@end iftex
1278 1271
1279@noindent 1272@noindent
1280Commands for use with Embedded Mode: 1273Commands for use with Embedded mode:
1281 1274
1282@table @kbd 1275@table @kbd
1283@item A 1276@item A
@@ -1343,7 +1336,7 @@ With any prefix argument, reset everything but the stack.
1343Calc was originally started as a two-week project to occupy a lull 1336Calc was originally started as a two-week project to occupy a lull
1344in the author's schedule. Basically, a friend asked if I remembered 1337in the author's schedule. Basically, a friend asked if I remembered
1345the value of 1338the value of
1346@texline @tmath{2^{32}}. 1339@texline @math{2^{32}}.
1347@infoline @expr{2^32}. 1340@infoline @expr{2^32}.
1348I didn't offhand, but I said, ``that's easy, just call up an 1341I didn't offhand, but I said, ``that's easy, just call up an
1349@code{xcalc}.'' @code{Xcalc} duly reported that the answer to our 1342@code{xcalc}.'' @code{Xcalc} duly reported that the answer to our
@@ -1485,9 +1478,9 @@ to skip on to the rest of this manual.
1485 1478
1486@c [fix-ref Embedded Mode] 1479@c [fix-ref Embedded Mode]
1487This tutorial describes the standard user interface of Calc only. 1480This tutorial describes the standard user interface of Calc only.
1488The ``Quick Mode'' and ``Keypad Mode'' interfaces are fairly 1481The Quick mode and Keypad mode interfaces are fairly
1489self-explanatory. @xref{Embedded Mode}, for a description of 1482self-explanatory. @xref{Embedded Mode}, for a description of
1490the ``Embedded Mode'' interface. 1483the Embedded mode interface.
1491 1484
1492@ifinfo 1485@ifinfo
1493The easiest way to read this tutorial on-line is to have two windows on 1486The easiest way to read this tutorial on-line is to have two windows on
@@ -1665,7 +1658,7 @@ multiplication.) Figure it out by hand, then try it with Calc to see
1665if you're right. @xref{RPN Answer 1, 1}. (@bullet{}) 1658if you're right. @xref{RPN Answer 1, 1}. (@bullet{})
1666 1659
1667(@bullet{}) @strong{Exercise 2.} Compute 1660(@bullet{}) @strong{Exercise 2.} Compute
1668@texline @tmath{(2\times4) + (7\times9.4) + {5\over4}} 1661@texline @math{(2\times4) + (7\times9.4) + {5\over4}}
1669@infoline @expr{2*4 + 7*9.5 + 5/4} 1662@infoline @expr{2*4 + 7*9.5 + 5/4}
1670using the stack. @xref{RPN Answer 2, 2}. (@bullet{}) 1663using the stack. @xref{RPN Answer 2, 2}. (@bullet{})
1671 1664
@@ -1947,8 +1940,8 @@ entire stack.)
1947 1940
1948@noindent 1941@noindent
1949If you are not used to RPN notation, you may prefer to operate the 1942If you are not used to RPN notation, you may prefer to operate the
1950Calculator in ``algebraic mode,'' which is closer to the way 1943Calculator in Algebraic mode, which is closer to the way
1951non-RPN calculators work. In algebraic mode, you enter formulas 1944non-RPN calculators work. In Algebraic mode, you enter formulas
1952in traditional @expr{2+3} notation. 1945in traditional @expr{2+3} notation.
1953 1946
1954You don't really need any special ``mode'' to enter algebraic formulas. 1947You don't really need any special ``mode'' to enter algebraic formulas.
@@ -2000,7 +1993,7 @@ $$ 2 + { 3 \times 4 \times 5 \over 6 \times 7^8 } - 9 $$
2000@end tex 1993@end tex
2001 1994
2002@noindent 1995@noindent
2003The result of this expression will be the number @i{-6.99999826533}. 1996The result of this expression will be the number @mathit{-6.99999826533}.
2004 1997
2005Calc's order of evaluation is the same as for most computer languages, 1998Calc's order of evaluation is the same as for most computer languages,
2006except that @samp{*} binds more strongly than @samp{/}, as the above 1999except that @samp{*} binds more strongly than @samp{/}, as the above
@@ -2009,18 +2002,18 @@ can often be omitted: @samp{2 a} is the same as @samp{2*a}.
2009 2002
2010Operators at the same level are evaluated from left to right, except 2003Operators at the same level are evaluated from left to right, except
2011that @samp{^} is evaluated from right to left. Thus, @samp{2-3-4} is 2004that @samp{^} is evaluated from right to left. Thus, @samp{2-3-4} is
2012equivalent to @samp{(2-3)-4} or @i{-5}, whereas @samp{2^3^4} is equivalent 2005equivalent to @samp{(2-3)-4} or @mathit{-5}, whereas @samp{2^3^4} is equivalent
2013to @samp{2^(3^4)} (a very large integer; try it!). 2006to @samp{2^(3^4)} (a very large integer; try it!).
2014 2007
2015If you tire of typing the apostrophe all the time, there is an 2008If you tire of typing the apostrophe all the time, there is
2016``algebraic mode'' you can select in which Calc automatically senses 2009Algebraic mode, where Calc automatically senses
2017when you are about to type an algebraic expression. To enter this 2010when you are about to type an algebraic expression. To enter this
2018mode, press the two letters @w{@kbd{m a}}. (An @samp{Alg} indicator 2011mode, press the two letters @w{@kbd{m a}}. (An @samp{Alg} indicator
2019should appear in the Calc window's mode line.) 2012should appear in the Calc window's mode line.)
2020 2013
2021Press @kbd{m a}, then @kbd{2+3+4} with no apostrophe, then @key{RET}. 2014Press @kbd{m a}, then @kbd{2+3+4} with no apostrophe, then @key{RET}.
2022 2015
2023In algebraic mode, when you press any key that would normally begin 2016In Algebraic mode, when you press any key that would normally begin
2024entering a number (such as a digit, a decimal point, or the @kbd{_} 2017entering a number (such as a digit, a decimal point, or the @kbd{_}
2025key), or if you press @kbd{(} or @kbd{[}, Calc automatically begins 2018key), or if you press @kbd{(} or @kbd{[}, Calc automatically begins
2026an algebraic entry. 2019an algebraic entry.
@@ -2035,7 +2028,7 @@ Press the apostrophe, then type @kbd{sqrt(5*2) - 3}. The result should
2035be @expr{0.16227766017}. 2028be @expr{0.16227766017}.
2036 2029
2037Note that if the formula begins with a function name, you need to use 2030Note that if the formula begins with a function name, you need to use
2038the apostrophe even if you are in algebraic mode. If you type @kbd{arcsin} 2031the apostrophe even if you are in Algebraic mode. If you type @kbd{arcsin}
2039out of the blue, the @kbd{a r} will be taken as an Algebraic Rewrite 2032out of the blue, the @kbd{a r} will be taken as an Algebraic Rewrite
2040command, and the @kbd{csin} will be taken as the name of the rewrite 2033command, and the @kbd{csin} will be taken as the name of the rewrite
2041rule to use! 2034rule to use!
@@ -2044,7 +2037,7 @@ Some people prefer to enter complex numbers and vectors in algebraic
2044form because they find RPN entry with incomplete objects to be too 2037form because they find RPN entry with incomplete objects to be too
2045distracting, even though they otherwise use Calc as an RPN calculator. 2038distracting, even though they otherwise use Calc as an RPN calculator.
2046 2039
2047Still in algebraic mode, type: 2040Still in Algebraic mode, type:
2048 2041
2049@smallexample 2042@smallexample
2050@group 2043@group
@@ -2060,15 +2053,15 @@ Algebraic mode allows us to enter complex numbers without pressing
2060an apostrophe first, but it also means we need to press @key{RET} 2053an apostrophe first, but it also means we need to press @key{RET}
2061after every entry, even for a simple number like @expr{1}. 2054after every entry, even for a simple number like @expr{1}.
2062 2055
2063(You can type @kbd{C-u m a} to enable a special ``incomplete algebraic 2056(You can type @kbd{C-u m a} to enable a special Incomplete Algebraic
2064mode'' in which the @kbd{(} and @kbd{[} keys use algebraic entry even 2057mode in which the @kbd{(} and @kbd{[} keys use algebraic entry even
2065though regular numeric keys still use RPN numeric entry. There is also 2058though regular numeric keys still use RPN numeric entry. There is also
2066a ``total algebraic mode,'' started by typing @kbd{m t}, in which all 2059Total Algebraic mode, started by typing @kbd{m t}, in which all
2067normal keys begin algebraic entry. You must then use the @key{META} key 2060normal keys begin algebraic entry. You must then use the @key{META} key
2068to type Calc commands: @kbd{M-m t} to get back out of total algebraic 2061to type Calc commands: @kbd{M-m t} to get back out of Total Algebraic
2069mode, @kbd{M-q} to quit, etc.) 2062mode, @kbd{M-q} to quit, etc.)
2070 2063
2071If you're still in algebraic mode, press @kbd{m a} again to turn it off. 2064If you're still in Algebraic mode, press @kbd{m a} again to turn it off.
2072 2065
2073Actual non-RPN calculators use a mixture of algebraic and RPN styles. 2066Actual non-RPN calculators use a mixture of algebraic and RPN styles.
2074In general, operators of two numbers (like @kbd{+} and @kbd{*}) 2067In general, operators of two numbers (like @kbd{+} and @kbd{*})
@@ -2079,7 +2072,7 @@ accomplish this in Calc by performing your calculation as a series
2079of algebraic entries, using the @kbd{$} sign to tie them together. 2072of algebraic entries, using the @kbd{$} sign to tie them together.
2080In an algebraic formula, @kbd{$} represents the number on the top 2073In an algebraic formula, @kbd{$} represents the number on the top
2081of the stack. Here, we perform the calculation 2074of the stack. Here, we perform the calculation
2082@texline @tmath{\sqrt{2\times4+1}}, 2075@texline @math{\sqrt{2\times4+1}},
2083@infoline @expr{sqrt(2*4+1)}, 2076@infoline @expr{sqrt(2*4+1)},
2084which on a traditional calculator would be done by pressing 2077which on a traditional calculator would be done by pressing
2085@kbd{2 * 4 + 1 =} and then the square-root key. 2078@kbd{2 * 4 + 1 =} and then the square-root key.
@@ -2383,7 +2376,7 @@ during entry of a number or algebraic formula.
2383@noindent 2376@noindent
2384Calc has many types of @dfn{modes} that affect the way it interprets 2377Calc has many types of @dfn{modes} that affect the way it interprets
2385your commands or the way it displays data. We have already seen one 2378your commands or the way it displays data. We have already seen one
2386mode, namely algebraic mode. There are many others, too; we'll 2379mode, namely Algebraic mode. There are many others, too; we'll
2387try some of the most common ones here. 2380try some of the most common ones here.
2388 2381
2389Perhaps the most fundamental mode in Calc is the current @dfn{precision}. 2382Perhaps the most fundamental mode in Calc is the current @dfn{precision}.
@@ -2741,11 +2734,11 @@ angle is measured in degrees. For example,
2741@noindent 2734@noindent
2742The shift-@kbd{S} command computes the sine of an angle. The sine 2735The shift-@kbd{S} command computes the sine of an angle. The sine
2743of 45 degrees is 2736of 45 degrees is
2744@texline @tmath{\sqrt{2}/2}; 2737@texline @math{\sqrt{2}/2};
2745@infoline @expr{sqrt(2)/2}; 2738@infoline @expr{sqrt(2)/2};
2746squaring this yields @expr{2/4 = 0.5}. However, there has been a slight 2739squaring this yields @expr{2/4 = 0.5}. However, there has been a slight
2747roundoff error because the representation of 2740roundoff error because the representation of
2748@texline @tmath{\sqrt{2}/2} 2741@texline @math{\sqrt{2}/2}
2749@infoline @expr{sqrt(2)/2} 2742@infoline @expr{sqrt(2)/2}
2750wasn't exact. The @kbd{c 1} command is a handy way to clean up numbers 2743wasn't exact. The @kbd{c 1} command is a handy way to clean up numbers
2751in this case; it temporarily reduces the precision by one digit while it 2744in this case; it temporarily reduces the precision by one digit while it
@@ -2786,7 +2779,7 @@ either radians or degrees, depending on the current angular mode.
2786 2779
2787@noindent 2780@noindent
2788Here we compute the Inverse Sine of 2781Here we compute the Inverse Sine of
2789@texline @tmath{\sqrt{0.5}}, 2782@texline @math{\sqrt{0.5}},
2790@infoline @expr{sqrt(0.5)}, 2783@infoline @expr{sqrt(0.5)},
2791first in radians, then in degrees. 2784first in radians, then in degrees.
2792 2785
@@ -2802,7 +2795,7 @@ and vice-versa.
2802@end group 2795@end group
2803@end smallexample 2796@end smallexample
2804 2797
2805Another interesting mode is @dfn{fraction mode}. Normally, 2798Another interesting mode is @dfn{Fraction mode}. Normally,
2806dividing two integers produces a floating-point result if the 2799dividing two integers produces a floating-point result if the
2807quotient can't be expressed as an exact integer. Fraction mode 2800quotient can't be expressed as an exact integer. Fraction mode
2808causes integer division to produce a fraction, i.e., a rational 2801causes integer division to produce a fraction, i.e., a rational
@@ -2826,7 +2819,7 @@ You can enter a fraction at any time using @kbd{:} notation.
2826(Calc uses @kbd{:} instead of @kbd{/} as the fraction separator 2819(Calc uses @kbd{:} instead of @kbd{/} as the fraction separator
2827because @kbd{/} is already used to divide the top two stack 2820because @kbd{/} is already used to divide the top two stack
2828elements.) Calculations involving fractions will always 2821elements.) Calculations involving fractions will always
2829produce exact fractional results; fraction mode only says 2822produce exact fractional results; Fraction mode only says
2830what to do when dividing two integers. 2823what to do when dividing two integers.
2831 2824
2832@cindex Fractions vs. floats 2825@cindex Fractions vs. floats
@@ -2837,7 +2830,7 @@ why would you ever use floating-point numbers instead?
2837 2830
2838Typing @kbd{m f} doesn't change any existing values in the stack. 2831Typing @kbd{m f} doesn't change any existing values in the stack.
2839In the above example, we had to Undo the division and do it over 2832In the above example, we had to Undo the division and do it over
2840again when we changed to fraction mode. But if you use the 2833again when we changed to Fraction mode. But if you use the
2841evaluates-to operator you can get commands like @kbd{m f} to 2834evaluates-to operator you can get commands like @kbd{m f} to
2842recompute for you. 2835recompute for you.
2843 2836
@@ -2853,7 +2846,7 @@ recompute for you.
2853@noindent 2846@noindent
2854In this example, the righthand side of the @samp{=>} operator 2847In this example, the righthand side of the @samp{=>} operator
2855on the stack is recomputed when we change the precision, then 2848on the stack is recomputed when we change the precision, then
2856again when we change to fraction mode. All @samp{=>} expressions 2849again when we change to Fraction mode. All @samp{=>} expressions
2857on the stack are recomputed every time you change any mode that 2850on the stack are recomputed every time you change any mode that
2858might affect their values. 2851might affect their values.
2859 2852
@@ -2974,9 +2967,9 @@ logarithm). These can be modified by the @kbd{I} (inverse) and
2974 2967
2975Let's compute the sine and cosine of an angle, and verify the 2968Let's compute the sine and cosine of an angle, and verify the
2976identity 2969identity
2977@texline @tmath{\sin^2x + \cos^2x = 1}. 2970@texline @math{\sin^2x + \cos^2x = 1}.
2978@infoline @expr{sin(x)^2 + cos(x)^2 = 1}. 2971@infoline @expr{sin(x)^2 + cos(x)^2 = 1}.
2979We'll arbitrarily pick @i{-64} degrees as a good value for @expr{x}. 2972We'll arbitrarily pick @mathit{-64} degrees as a good value for @expr{x}.
2980With the angular mode set to degrees (type @w{@kbd{m d}}), do: 2973With the angular mode set to degrees (type @w{@kbd{m d}}), do:
2981 2974
2982@smallexample 2975@smallexample
@@ -2997,7 +2990,7 @@ Remember, @kbd{f h} is the @code{calc-hypot}, or square-root of sum
2997of squares, command. 2990of squares, command.
2998 2991
2999Another identity is 2992Another identity is
3000@texline @tmath{\displaystyle\tan x = {\sin x \over \cos x}}. 2993@texline @math{\displaystyle\tan x = {\sin x \over \cos x}}.
3001@infoline @expr{tan(x) = sin(x) / cos(x)}. 2994@infoline @expr{tan(x) = sin(x) / cos(x)}.
3002@smallexample 2995@smallexample
3003@group 2996@group
@@ -3012,7 +3005,7 @@ Another identity is
3012 3005
3013A physical interpretation of this calculation is that if you move 3006A physical interpretation of this calculation is that if you move
3014@expr{0.89879} units downward and @expr{0.43837} units to the right, 3007@expr{0.89879} units downward and @expr{0.43837} units to the right,
3015your direction of motion is @i{-64} degrees from horizontal. Suppose 3008your direction of motion is @mathit{-64} degrees from horizontal. Suppose
3016we move in the opposite direction, up and to the left: 3009we move in the opposite direction, up and to the left:
3017 3010
3018@smallexample 3011@smallexample
@@ -3060,7 +3053,7 @@ the top two stack elements right after the @kbd{U U}, then a pair of
3060 3053
3061A similar identity is supposed to hold for hyperbolic sines and cosines, 3054A similar identity is supposed to hold for hyperbolic sines and cosines,
3062except that it is the @emph{difference} 3055except that it is the @emph{difference}
3063@texline @tmath{\cosh^2x - \sinh^2x} 3056@texline @math{\cosh^2x - \sinh^2x}
3064@infoline @expr{cosh(x)^2 - sinh(x)^2} 3057@infoline @expr{cosh(x)^2 - sinh(x)^2}
3065that always equals one. Let's try to verify this identity. 3058that always equals one. Let's try to verify this identity.
3066 3059
@@ -3167,7 +3160,7 @@ in this case).
3167 3160
3168If you take the factorial of a non-integer, Calc uses a generalized 3161If you take the factorial of a non-integer, Calc uses a generalized
3169factorial function defined in terms of Euler's Gamma function 3162factorial function defined in terms of Euler's Gamma function
3170@texline @tmath{\Gamma(n)} 3163@texline @math{\Gamma(n)}
3171@infoline @expr{gamma(n)} 3164@infoline @expr{gamma(n)}
3172(which is itself available as the @kbd{f g} command). 3165(which is itself available as the @kbd{f g} command).
3173 3166
@@ -3184,13 +3177,13 @@ factorial function defined in terms of Euler's Gamma function
3184 3177
3185@noindent 3178@noindent
3186Here we verify the identity 3179Here we verify the identity
3187@texline @tmath{n! = \Gamma(n+1)}. 3180@texline @math{n! = \Gamma(n+1)}.
3188@infoline @expr{@var{n}!@: = gamma(@var{n}+1)}. 3181@infoline @expr{@var{n}!@: = gamma(@var{n}+1)}.
3189 3182
3190The binomial coefficient @var{n}-choose-@var{m} 3183The binomial coefficient @var{n}-choose-@var{m}
3191@texline or @tmath{\displaystyle {n \choose m}} 3184@texline or @math{\displaystyle {n \choose m}}
3192is defined by 3185is defined by
3193@texline @tmath{\displaystyle {n! \over m! \, (n-m)!}} 3186@texline @math{\displaystyle {n! \over m! \, (n-m)!}}
3194@infoline @expr{n!@: / m!@: (n-m)!} 3187@infoline @expr{n!@: / m!@: (n-m)!}
3195for all reals @expr{n} and @expr{m}. The intermediate results in this 3188for all reals @expr{n} and @expr{m}. The intermediate results in this
3196formula can become quite large even if the final result is small; the 3189formula can become quite large even if the final result is small; the
@@ -3475,7 +3468,7 @@ vector.
3475 3468
3476(@bullet{}) @strong{Exercise 1.} Use @samp{*} to sum along the rows 3469(@bullet{}) @strong{Exercise 1.} Use @samp{*} to sum along the rows
3477of the above 3470of the above
3478@texline @tmath{2\times3} 3471@texline @math{2\times3}
3479@infoline 2x3 3472@infoline 2x3
3480matrix to get @expr{[6, 15]}. Now use @samp{*} to sum along the columns 3473matrix to get @expr{[6, 15]}. Now use @samp{*} to sum along the columns
3481to get @expr{[5, 7, 9]}. 3474to get @expr{[5, 7, 9]}.
@@ -3626,10 +3619,10 @@ assume the vector was a row vector in order to make the dimensions
3626come out right, and the answer would be incorrect. If you 3619come out right, and the answer would be incorrect. If you
3627don't feel safe letting Calc take either interpretation of your 3620don't feel safe letting Calc take either interpretation of your
3628vectors, use explicit 3621vectors, use explicit
3629@texline @tmath{N\times1} 3622@texline @math{N\times1}
3630@infoline Nx1 3623@infoline Nx1
3631or 3624or
3632@texline @tmath{1\times N} 3625@texline @math{1\times N}
3633@infoline 1xN 3626@infoline 1xN
3634matrices instead. In this case, you would enter the original column 3627matrices instead. In this case, you would enter the original column
3635vector as @samp{[[6], [2], [3]]} or @samp{[6; 2; 3]}. 3628vector as @samp{[[6], [2], [3]]} or @samp{[6; 2; 3]}.
@@ -3678,7 +3671,7 @@ on the left by the transpose of @expr{A}:
3678$A^T A \, X = A^T B$, where $A^T$ is the transpose \samp{trn(A)}. 3671$A^T A \, X = A^T B$, where $A^T$ is the transpose \samp{trn(A)}.
3679@end tex 3672@end tex
3680Now 3673Now
3681@texline @tmath{A^T A} 3674@texline @math{A^T A}
3682@infoline @expr{trn(A)*A} 3675@infoline @expr{trn(A)*A}
3683is a square matrix so a solution is possible. It turns out that the 3676is a square matrix so a solution is possible. It turns out that the
3684@expr{X} vector you compute in this way will be a ``least-squares'' 3677@expr{X} vector you compute in this way will be a ``least-squares''
@@ -3774,7 +3767,7 @@ of each element.
3774 3767
3775(@bullet{}) @strong{Exercise 1.} Compute a vector of powers of two 3768(@bullet{}) @strong{Exercise 1.} Compute a vector of powers of two
3776from 3769from
3777@texline @tmath{2^{-4}} 3770@texline @math{2^{-4}}
3778@infoline @expr{2^-4} 3771@infoline @expr{2^-4}
3779to @expr{2^4}. @xref{List Answer 1, 1}. (@bullet{}) 3772to @expr{2^4}. @xref{List Answer 1, 1}. (@bullet{})
3780 3773
@@ -3978,7 +3971,7 @@ $$ m = {N \sum x y - \sum x \sum y \over
3978 3971
3979@noindent 3972@noindent
3980where 3973where
3981@texline @tmath{\sum x} 3974@texline @math{\sum x}
3982@infoline @expr{sum(x)} 3975@infoline @expr{sum(x)}
3983represents the sum of all the values of @expr{x}. While there is an 3976represents the sum of all the values of @expr{x}. While there is an
3984actual @code{sum} function in Calc, it's easier to sum a vector using a 3977actual @code{sum} function in Calc, it's easier to sum a vector using a
@@ -4083,7 +4076,7 @@ $$ b = {\sum y - m \sum x \over N} $$
4083@end smallexample 4076@end smallexample
4084 4077
4085Let's ``plot'' this straight line approximation, 4078Let's ``plot'' this straight line approximation,
4086@texline @tmath{y \approx m x + b}, 4079@texline @math{y \approx m x + b},
4087@infoline @expr{m x + b}, 4080@infoline @expr{m x + b},
4088and compare it with the original data. 4081and compare it with the original data.
4089 4082
@@ -4336,7 +4329,7 @@ command to enable multi-line display of vectors.)
4336@cindex Maximizing a function over a list of values 4329@cindex Maximizing a function over a list of values
4337@c [fix-ref Numerical Solutions] 4330@c [fix-ref Numerical Solutions]
4338(@bullet{}) @strong{Exercise 8.} Compute a list of values of Bessel's 4331(@bullet{}) @strong{Exercise 8.} Compute a list of values of Bessel's
4339@texline @tmath{J_1(x)} 4332@texline @math{J_1(x)}
4340@infoline @expr{J1} 4333@infoline @expr{J1}
4341function @samp{besJ(1,x)} for @expr{x} from 0 to 5 in steps of 0.25. 4334function @samp{besJ(1,x)} for @expr{x} from 0 to 5 in steps of 0.25.
4342Find the value of @expr{x} (from among the above set of values) for 4335Find the value of @expr{x} (from among the above set of values) for
@@ -4348,7 +4341,7 @@ of thing automatically; @pxref{Numerical Solutions}.)
4348 4341
4349@cindex Digits, vectors of 4342@cindex Digits, vectors of
4350(@bullet{}) @strong{Exercise 9.} You are given an integer in the range 4343(@bullet{}) @strong{Exercise 9.} You are given an integer in the range
4351@texline @tmath{0 \le N < 10^m} 4344@texline @math{0 \le N < 10^m}
4352@infoline @expr{0 <= N < 10^m} 4345@infoline @expr{0 <= N < 10^m}
4353for @expr{m=12} (i.e., an integer of less than 4346for @expr{m=12} (i.e., an integer of less than
4354twelve digits). Convert this integer into a vector of @expr{m} 4347twelve digits). Convert this integer into a vector of @expr{m}
@@ -4364,14 +4357,14 @@ happened? How would you do this test? @xref{List Answer 10, 10}. (@bullet{})
4364 4357
4365(@bullet{}) @strong{Exercise 11.} The area of a circle of radius one 4358(@bullet{}) @strong{Exercise 11.} The area of a circle of radius one
4366is @cpi{}. The area of the 4359is @cpi{}. The area of the
4367@texline @tmath{2\times2} 4360@texline @math{2\times2}
4368@infoline 2x2 4361@infoline 2x2
4369square that encloses that circle is 4. So if we throw @var{n} darts at 4362square that encloses that circle is 4. So if we throw @var{n} darts at
4370random points in the square, about @cpiover{4} of them will land inside 4363random points in the square, about @cpiover{4} of them will land inside
4371the circle. This gives us an entertaining way to estimate the value of 4364the circle. This gives us an entertaining way to estimate the value of
4372@cpi{}. The @w{@kbd{k r}} 4365@cpi{}. The @w{@kbd{k r}}
4373command picks a random number between zero and the value on the stack. 4366command picks a random number between zero and the value on the stack.
4374We could get a random floating-point number between @i{-1} and 1 by typing 4367We could get a random floating-point number between @mathit{-1} and 1 by typing
4375@w{@kbd{2.0 k r 1 -}}. Build a vector of 100 random @expr{(x,y)} points in 4368@w{@kbd{2.0 k r 1 -}}. Build a vector of 100 random @expr{(x,y)} points in
4376this square, then use vector mapping and reduction to count how many 4369this square, then use vector mapping and reduction to count how many
4377points lie inside the unit circle. Hint: Use the @kbd{v b} command. 4370points lie inside the unit circle. Hint: Use the @kbd{v b} command.
@@ -4383,12 +4376,12 @@ another way to calculate @cpi{}. Say you have an infinite field
4383of vertical lines with a spacing of one inch. Toss a one-inch matchstick 4376of vertical lines with a spacing of one inch. Toss a one-inch matchstick
4384onto the field. The probability that the matchstick will land crossing 4377onto the field. The probability that the matchstick will land crossing
4385a line turns out to be 4378a line turns out to be
4386@texline @tmath{2/\pi}. 4379@texline @math{2/\pi}.
4387@infoline @expr{2/pi}. 4380@infoline @expr{2/pi}.
4388Toss 100 matchsticks to estimate @cpi{}. (If you want still more fun, 4381Toss 100 matchsticks to estimate @cpi{}. (If you want still more fun,
4389the probability that the GCD (@w{@kbd{k g}}) of two large integers is 4382the probability that the GCD (@w{@kbd{k g}}) of two large integers is
4390one turns out to be 4383one turns out to be
4391@texline @tmath{6/\pi^2}. 4384@texline @math{6/\pi^2}.
4392@infoline @expr{6/pi^2}. 4385@infoline @expr{6/pi^2}.
4393That provides yet another way to estimate @cpi{}.) 4386That provides yet another way to estimate @cpi{}.)
4394@xref{List Answer 12, 12}. (@bullet{}) 4387@xref{List Answer 12, 12}. (@bullet{})
@@ -4418,7 +4411,7 @@ value and a number of steps @var{n} from the stack; it then applies the
4418function you give to the starting value 0, 1, 2, up to @var{n} times 4411function you give to the starting value 0, 1, 2, up to @var{n} times
4419and returns a vector of the results. Use this command to create a 4412and returns a vector of the results. Use this command to create a
4420``random walk'' of 50 steps. Start with the two-dimensional point 4413``random walk'' of 50 steps. Start with the two-dimensional point
4421@expr{(0,0)}; then take one step a random distance between @i{-1} and 1 4414@expr{(0,0)}; then take one step a random distance between @mathit{-1} and 1
4422in both @expr{x} and @expr{y}; then take another step, and so on. Use the 4415in both @expr{x} and @expr{y}; then take another step, and so on. Use the
4423@kbd{g f} command to display this random walk. Now modify your random 4416@kbd{g f} command to display this random walk. Now modify your random
4424walk to walk a unit distance, but in a random direction, at each step. 4417walk to walk a unit distance, but in a random direction, at each step.
@@ -4497,7 +4490,7 @@ to allow for roundoff error!) @xref{Types Answer 1, 1}. (@bullet{})
4497@end smallexample 4490@end smallexample
4498 4491
4499@noindent 4492@noindent
4500The square root of @i{-9} is by default rendered in rectangular form 4493The square root of @mathit{-9} is by default rendered in rectangular form
4501(@w{@expr{0 + 3i}}), but we can convert it to polar form (3 with a 4494(@w{@expr{0 + 3i}}), but we can convert it to polar form (3 with a
4502phase angle of 90 degrees). All the usual arithmetic and scientific 4495phase angle of 90 degrees). All the usual arithmetic and scientific
4503operations are defined on both types of complex numbers. 4496operations are defined on both types of complex numbers.
@@ -4522,14 +4515,14 @@ algebraic entry.
4522 4515
4523@noindent 4516@noindent
4524Since infinity is infinitely large, multiplying it by any finite 4517Since infinity is infinitely large, multiplying it by any finite
4525number (like @i{-17}) has no effect, except that since @i{-17} 4518number (like @mathit{-17}) has no effect, except that since @mathit{-17}
4526is negative, it changes a plus infinity to a minus infinity. 4519is negative, it changes a plus infinity to a minus infinity.
4527(``A huge positive number, multiplied by @i{-17}, yields a huge 4520(``A huge positive number, multiplied by @mathit{-17}, yields a huge
4528negative number.'') Adding any finite number to infinity also 4521negative number.'') Adding any finite number to infinity also
4529leaves it unchanged. Taking an absolute value gives us plus 4522leaves it unchanged. Taking an absolute value gives us plus
4530infinity again. Finally, we add this plus infinity to the minus 4523infinity again. Finally, we add this plus infinity to the minus
4531infinity we had earlier. If you work it out, you might expect 4524infinity we had earlier. If you work it out, you might expect
4532the answer to be @i{-72} for this. But the 72 has been completely 4525the answer to be @mathit{-72} for this. But the 72 has been completely
4533lost next to the infinities; by the time we compute @w{@samp{inf - inf}} 4526lost next to the infinities; by the time we compute @w{@samp{inf - inf}}
4534the finite difference between them, if any, is undetectable. 4527the finite difference between them, if any, is undetectable.
4535So we say the result is @dfn{indeterminate}, which Calc writes 4528So we say the result is @dfn{indeterminate}, which Calc writes
@@ -4537,7 +4530,7 @@ with the symbol @code{nan} (for Not A Number).
4537 4530
4538Dividing by zero is normally treated as an error, but you can get 4531Dividing by zero is normally treated as an error, but you can get
4539Calc to write an answer in terms of infinity by pressing @kbd{m i} 4532Calc to write an answer in terms of infinity by pressing @kbd{m i}
4540to turn on ``infinite mode.'' 4533to turn on Infinite mode.
4541 4534
4542@smallexample 4535@smallexample
4543@group 4536@group
@@ -4686,7 +4679,7 @@ a 60% chance that the result is correct within 0.59 degrees.
4686 4679
4687@cindex Torus, volume of 4680@cindex Torus, volume of
4688(@bullet{}) @strong{Exercise 7.} The volume of a torus (a donut shape) is 4681(@bullet{}) @strong{Exercise 7.} The volume of a torus (a donut shape) is
4689@texline @tmath{2 \pi^2 R r^2} 4682@texline @math{2 \pi^2 R r^2}
4690@infoline @w{@expr{2 pi^2 R r^2}} 4683@infoline @w{@expr{2 pi^2 R r^2}}
4691where @expr{R} is the radius of the circle that 4684where @expr{R} is the radius of the circle that
4692defines the center of the tube and @expr{r} is the radius of the tube 4685defines the center of the tube and @expr{r} is the radius of the tube
@@ -4764,10 +4757,11 @@ or 24 hours.
4764@end smallexample 4757@end smallexample
4765 4758
4766@noindent 4759@noindent
4767In this last step, Calc has found a new number which, when multiplied 4760In this last step, Calc has divided by 5 modulo 24; i.e., it has found a
4768by 5 modulo 24, produces the original number, 21. If @var{m} is prime 4761new number which, when multiplied by 5 modulo 24, produces the original
4769it is always possible to find such a number. For non-prime @var{m} 4762number, 21. If @var{m} is prime and the divisor is not a multiple of
4770like 24, it is only sometimes possible. 4763@var{m}, it is always possible to find such a number. For non-prime
4764@var{m} like 24, it is only sometimes possible.
4771 4765
4772@smallexample 4766@smallexample
4773@group 4767@group
@@ -4786,7 +4780,7 @@ that arises in the second one.
4786@cindex Fermat, primality test of 4780@cindex Fermat, primality test of
4787(@bullet{}) @strong{Exercise 10.} A theorem of Pierre de Fermat 4781(@bullet{}) @strong{Exercise 10.} A theorem of Pierre de Fermat
4788says that 4782says that
4789@texline @w{@tmath{x^{n-1} \bmod n = 1}} 4783@texline @w{@math{x^{n-1} \bmod n = 1}}
4790@infoline @expr{x^(n-1) mod n = 1} 4784@infoline @expr{x^(n-1) mod n = 1}
4791if @expr{n} is a prime number and @expr{x} is an integer less than 4785if @expr{n} is a prime number and @expr{x} is an integer less than
4792@expr{n}. If @expr{n} is @emph{not} a prime number, this will 4786@expr{n}. If @expr{n} is @emph{not} a prime number, this will
@@ -4814,7 +4808,7 @@ This calculation tells me it is six hours and 22 minutes until midnight.
4814 4808
4815(@bullet{}) @strong{Exercise 11.} A rule of thumb is that one year 4809(@bullet{}) @strong{Exercise 11.} A rule of thumb is that one year
4816is about 4810is about
4817@texline @tmath{\pi \times 10^7} 4811@texline @math{\pi \times 10^7}
4818@infoline @w{@expr{pi * 10^7}} 4812@infoline @w{@expr{pi * 10^7}}
4819seconds. What time will it be that many seconds from right now? 4813seconds. What time will it be that many seconds from right now?
4820@xref{Types Answer 11, 11}. (@bullet{}) 4814@xref{Types Answer 11, 11}. (@bullet{})
@@ -4967,7 +4961,7 @@ formulas.
4967@subsection Basic Algebra 4961@subsection Basic Algebra
4968 4962
4969@noindent 4963@noindent
4970If you enter a formula in algebraic mode that refers to variables, 4964If you enter a formula in Algebraic mode that refers to variables,
4971the formula itself is pushed onto the stack. You can manipulate 4965the formula itself is pushed onto the stack. You can manipulate
4972formulas as regular data objects. 4966formulas as regular data objects.
4973 4967
@@ -5121,7 +5115,7 @@ solution by pressing @kbd{H} (the Hyperbolic flag) before @kbd{a S}.
5121 5115
5122@noindent 5116@noindent
5123Calc has invented the variable @samp{s1} to represent an unknown sign; 5117Calc has invented the variable @samp{s1} to represent an unknown sign;
5124it is supposed to be either @i{+1} or @i{-1}. Here we have used 5118it is supposed to be either @mathit{+1} or @mathit{-1}. Here we have used
5125the ``let'' command to evaluate the expression when the sign is negative. 5119the ``let'' command to evaluate the expression when the sign is negative.
5126If we plugged this into our second derivative we would get the same, 5120If we plugged this into our second derivative we would get the same,
5127negative, answer, so @expr{x = -1.19023} is also a maximum. 5121negative, answer, so @expr{x = -1.19023} is also a maximum.
@@ -5188,7 +5182,7 @@ polynomial? (The answer will be unique to within a constant
5188multiple; choose the solution where the leading coefficient is one.) 5182multiple; choose the solution where the leading coefficient is one.)
5189@xref{Algebra Answer 2, 2}. (@bullet{}) 5183@xref{Algebra Answer 2, 2}. (@bullet{})
5190 5184
5191The @kbd{m s} command enables ``symbolic mode,'' in which formulas 5185The @kbd{m s} command enables Symbolic mode, in which formulas
5192like @samp{sqrt(5)} that can't be evaluated exactly are left in 5186like @samp{sqrt(5)} that can't be evaluated exactly are left in
5193symbolic form rather than giving a floating-point approximate answer. 5187symbolic form rather than giving a floating-point approximate answer.
5194Fraction mode (@kbd{m f}) is also useful when doing algebra. 5188Fraction mode (@kbd{m f}) is also useful when doing algebra.
@@ -5203,7 +5197,7 @@ Fraction mode (@kbd{m f}) is also useful when doing algebra.
5203@end group 5197@end group
5204@end smallexample 5198@end smallexample
5205 5199
5206One more mode that makes reading formulas easier is ``Big mode.'' 5200One more mode that makes reading formulas easier is Big mode.
5207 5201
5208@smallexample 5202@smallexample
5209@group 5203@group
@@ -5291,7 +5285,7 @@ One way to do it is again with vector mapping and reduction:
5291 5285
5292(@bullet{}) @strong{Exercise 3.} Find the integral from 1 to @expr{y} 5286(@bullet{}) @strong{Exercise 3.} Find the integral from 1 to @expr{y}
5293of 5287of
5294@texline @tmath{x \sin \pi x} 5288@texline @math{x \sin \pi x}
5295@infoline @w{@expr{x sin(pi x)}} 5289@infoline @w{@expr{x sin(pi x)}}
5296(where the sine is calculated in radians). Find the values of the 5290(where the sine is calculated in radians). Find the values of the
5297integral for integers @expr{y} from 1 to 5. @xref{Algebra Answer 3, 5291integral for integers @expr{y} from 1 to 5. @xref{Algebra Answer 3,
@@ -5300,7 +5294,7 @@ integral for integers @expr{y} from 1 to 5. @xref{Algebra Answer 3,
5300Calc's integrator can do many simple integrals symbolically, but many 5294Calc's integrator can do many simple integrals symbolically, but many
5301others are beyond its capabilities. Suppose we wish to find the area 5295others are beyond its capabilities. Suppose we wish to find the area
5302under the curve 5296under the curve
5303@texline @tmath{\sin x \ln x} 5297@texline @math{\sin x \ln x}
5304@infoline @expr{sin(x) ln(x)} 5298@infoline @expr{sin(x) ln(x)}
5305over the same range of @expr{x}. If you entered this formula and typed 5299over the same range of @expr{x}. If you entered this formula and typed
5306@kbd{a i x @key{RET}} (don't bother to try this), Calc would work for a 5300@kbd{a i x @key{RET}} (don't bother to try this), Calc would work for a
@@ -5351,7 +5345,7 @@ also have used plain @kbd{v x} as follows: @kbd{v x 10 @key{RET} 9 + .1 *}.)
5351 5345
5352@noindent 5346@noindent
5353(If you got wildly different results, did you remember to switch 5347(If you got wildly different results, did you remember to switch
5354to radians mode?) 5348to Radians mode?)
5355 5349
5356Here we have divided the curve into ten segments of equal width; 5350Here we have divided the curve into ten segments of equal width;
5357approximating these segments as rectangular boxes (i.e., assuming 5351approximating these segments as rectangular boxes (i.e., assuming
@@ -5442,7 +5436,7 @@ $$ h (f(a) + f(a+h) + f(a+2h) + f(a+3h) + \cdots
5442@end tex 5436@end tex
5443 5437
5444Compute the integral from 1 to 2 of 5438Compute the integral from 1 to 2 of
5445@texline @tmath{\sin x \ln x} 5439@texline @math{\sin x \ln x}
5446@infoline @expr{sin(x) ln(x)} 5440@infoline @expr{sin(x) ln(x)}
5447using Simpson's rule with 10 slices. 5441using Simpson's rule with 10 slices.
5448@xref{Algebra Answer 4, 4}. (@bullet{}) 5442@xref{Algebra Answer 4, 4}. (@bullet{})
@@ -5607,7 +5601,7 @@ only once and stores the compiled form along with the variable. That's
5607another good reason to store your rules in variables rather than 5601another good reason to store your rules in variables rather than
5608entering them on the fly. 5602entering them on the fly.
5609 5603
5610(@bullet{}) @strong{Exercise 1.} Type @kbd{m s} to get symbolic 5604(@bullet{}) @strong{Exercise 1.} Type @kbd{m s} to get Symbolic
5611mode, then enter the formula @samp{@w{(2 + sqrt(2))} / @w{(1 + sqrt(2))}}. 5605mode, then enter the formula @samp{@w{(2 + sqrt(2))} / @w{(1 + sqrt(2))}}.
5612Using a rewrite rule, simplify this formula by multiplying both 5606Using a rewrite rule, simplify this formula by multiplying both
5613sides by the conjugate @w{@samp{1 - sqrt(2)}}. The result will have 5607sides by the conjugate @w{@samp{1 - sqrt(2)}}. The result will have
@@ -5866,11 +5860,11 @@ so that @expr{2 - 3 (x + y) + x y} is a sum of three terms.)
5866@xref{Rewrites Answer 5, 5}. (@bullet{}) 5860@xref{Rewrites Answer 5, 5}. (@bullet{})
5867 5861
5868(@bullet{}) @strong{Exercise 6.} Calc considers the form @expr{0^0} 5862(@bullet{}) @strong{Exercise 6.} Calc considers the form @expr{0^0}
5869to be ``indeterminate,'' and leaves it unevaluated (assuming infinite 5863to be ``indeterminate,'' and leaves it unevaluated (assuming Infinite
5870mode is not enabled). Some people prefer to define @expr{0^0 = 1}, 5864mode is not enabled). Some people prefer to define @expr{0^0 = 1},
5871so that the identity @expr{x^0 = 1} can safely be used for all @expr{x}. 5865so that the identity @expr{x^0 = 1} can safely be used for all @expr{x}.
5872Find a way to make Calc follow this convention. What happens if you 5866Find a way to make Calc follow this convention. What happens if you
5873now type @kbd{m i} to turn on infinite mode? 5867now type @kbd{m i} to turn on Infinite mode?
5874@xref{Rewrites Answer 6, 6}. (@bullet{}) 5868@xref{Rewrites Answer 6, 6}. (@bullet{})
5875 5869
5876(@bullet{}) @strong{Exercise 7.} A Taylor series for a function is an 5870(@bullet{}) @strong{Exercise 7.} A Taylor series for a function is an
@@ -5988,7 +5982,7 @@ in @samp{a + 1} for @samp{x} in the defining formula.
5988@end ignore 5982@end ignore
5989@tindex Si 5983@tindex Si
5990(@bullet{}) @strong{Exercise 1.} The ``sine integral'' function 5984(@bullet{}) @strong{Exercise 1.} The ``sine integral'' function
5991@texline @tmath{{\rm Si}(x)} 5985@texline @math{{\rm Si}(x)}
5992@infoline @expr{Si(x)} 5986@infoline @expr{Si(x)}
5993is defined as the integral of @samp{sin(t)/t} for 5987is defined as the integral of @samp{sin(t)/t} for
5994@expr{t = 0} to @expr{x} in radians. (It was invented because this 5988@expr{t = 0} to @expr{x} in radians. (It was invented because this
@@ -6066,7 +6060,7 @@ the following functions:
6066@enumerate 6060@enumerate
6067@item 6061@item
6068Compute 6062Compute
6069@texline @tmath{\displaystyle{\sin x \over x}}, 6063@texline @math{\displaystyle{\sin x \over x}},
6070@infoline @expr{sin(x) / x}, 6064@infoline @expr{sin(x) / x},
6071where @expr{x} is the number on the top of the stack. 6065where @expr{x} is the number on the top of the stack.
6072 6066
@@ -6132,13 +6126,13 @@ key if you have one, makes a copy of the number in level 2.)
6132@cindex Phi, golden ratio 6126@cindex Phi, golden ratio
6133A fascinating property of the Fibonacci numbers is that the @expr{n}th 6127A fascinating property of the Fibonacci numbers is that the @expr{n}th
6134Fibonacci number can be found directly by computing 6128Fibonacci number can be found directly by computing
6135@texline @tmath{\phi^n / \sqrt{5}} 6129@texline @math{\phi^n / \sqrt{5}}
6136@infoline @expr{phi^n / sqrt(5)} 6130@infoline @expr{phi^n / sqrt(5)}
6137and then rounding to the nearest integer, where 6131and then rounding to the nearest integer, where
6138@texline @tmath{\phi} (``phi''), 6132@texline @math{\phi} (``phi''),
6139@infoline @expr{phi}, 6133@infoline @expr{phi},
6140the ``golden ratio,'' is 6134the ``golden ratio,'' is
6141@texline @tmath{(1 + \sqrt{5}) / 2}. 6135@texline @math{(1 + \sqrt{5}) / 2}.
6142@infoline @expr{(1 + sqrt(5)) / 2}. 6136@infoline @expr{(1 + sqrt(5)) / 2}.
6143(For convenience, this constant is available from the @code{phi} 6137(For convenience, this constant is available from the @code{phi}
6144variable, or the @kbd{I H P} command.) 6138variable, or the @kbd{I H P} command.)
@@ -6155,17 +6149,17 @@ variable, or the @kbd{I H P} command.)
6155@cindex Continued fractions 6149@cindex Continued fractions
6156(@bullet{}) @strong{Exercise 5.} The @dfn{continued fraction} 6150(@bullet{}) @strong{Exercise 5.} The @dfn{continued fraction}
6157representation of 6151representation of
6158@texline @tmath{\phi} 6152@texline @math{\phi}
6159@infoline @expr{phi} 6153@infoline @expr{phi}
6160is 6154is
6161@texline @tmath{1 + 1/(1 + 1/(1 + 1/( \ldots )))}. 6155@texline @math{1 + 1/(1 + 1/(1 + 1/( \ldots )))}.
6162@infoline @expr{1 + 1/(1 + 1/(1 + 1/( ...@: )))}. 6156@infoline @expr{1 + 1/(1 + 1/(1 + 1/( ...@: )))}.
6163We can compute an approximate value by carrying this however far 6157We can compute an approximate value by carrying this however far
6164and then replacing the innermost 6158and then replacing the innermost
6165@texline @tmath{1/( \ldots )} 6159@texline @math{1/( \ldots )}
6166@infoline @expr{1/( ...@: )} 6160@infoline @expr{1/( ...@: )}
6167by 1. Approximate 6161by 1. Approximate
6168@texline @tmath{\phi} 6162@texline @math{\phi}
6169@infoline @expr{phi} 6163@infoline @expr{phi}
6170using a twenty-term continued fraction. 6164using a twenty-term continued fraction.
6171@xref{Programming Answer 5, 5}. (@bullet{}) 6165@xref{Programming Answer 5, 5}. (@bullet{})
@@ -6265,7 +6259,7 @@ The @dfn{Bernoulli numbers} are a sequence with the interesting
6265property that all of the odd Bernoulli numbers are zero, and the 6259property that all of the odd Bernoulli numbers are zero, and the
6266even ones, while difficult to compute, can be roughly approximated 6260even ones, while difficult to compute, can be roughly approximated
6267by the formula 6261by the formula
6268@texline @tmath{\displaystyle{2 n! \over (2 \pi)^n}}. 6262@texline @math{\displaystyle{2 n! \over (2 \pi)^n}}.
6269@infoline @expr{2 n!@: / (2 pi)^n}. 6263@infoline @expr{2 n!@: / (2 pi)^n}.
6270Let's write a keyboard macro to compute (approximate) Bernoulli numbers. 6264Let's write a keyboard macro to compute (approximate) Bernoulli numbers.
6271(Calc has a command, @kbd{k b}, to compute exact Bernoulli numbers, but 6265(Calc has a command, @kbd{k b}, to compute exact Bernoulli numbers, but
@@ -6439,14 +6433,14 @@ $$ x_{\rm new} = x - {f(x) \over f'(x)} $$
6439@noindent 6433@noindent
6440where @expr{f'(x)} is the derivative of @expr{f}. The @expr{x} 6434where @expr{f'(x)} is the derivative of @expr{f}. The @expr{x}
6441values will quickly converge to a solution, i.e., eventually 6435values will quickly converge to a solution, i.e., eventually
6442@texline @tmath{x_{\rm new}} 6436@texline @math{x_{\rm new}}
6443@infoline @expr{new_x} 6437@infoline @expr{new_x}
6444and @expr{x} will be equal to within the limits 6438and @expr{x} will be equal to within the limits
6445of the current precision. Write a program which takes a formula 6439of the current precision. Write a program which takes a formula
6446involving the variable @expr{x}, and an initial guess @expr{x_0}, 6440involving the variable @expr{x}, and an initial guess @expr{x_0},
6447on the stack, and produces a value of @expr{x} for which the formula 6441on the stack, and produces a value of @expr{x} for which the formula
6448is zero. Use it to find a solution of 6442is zero. Use it to find a solution of
6449@texline @tmath{\sin(\cos x) = 0.5} 6443@texline @math{\sin(\cos x) = 0.5}
6450@infoline @expr{sin(cos(x)) = 0.5} 6444@infoline @expr{sin(cos(x)) = 0.5}
6451near @expr{x = 4.5}. (Use angles measured in radians.) Note that 6445near @expr{x = 4.5}. (Use angles measured in radians.) Note that
6452the built-in @w{@kbd{a R}} (@code{calc-find-root}) command uses Newton's 6446the built-in @w{@kbd{a R}} (@code{calc-find-root}) command uses Newton's
@@ -6456,10 +6450,10 @@ method when it is able. @xref{Programming Answer 8, 8}. (@bullet{})
6456@cindex Gamma constant, Euler's 6450@cindex Gamma constant, Euler's
6457@cindex Euler's gamma constant 6451@cindex Euler's gamma constant
6458(@bullet{}) @strong{Exercise 9.} The @dfn{digamma} function 6452(@bullet{}) @strong{Exercise 9.} The @dfn{digamma} function
6459@texline @tmath{\psi(z) (``psi'')} 6453@texline @math{\psi(z) (``psi'')}
6460@infoline @expr{psi(z)} 6454@infoline @expr{psi(z)}
6461is defined as the derivative of 6455is defined as the derivative of
6462@texline @tmath{\ln \Gamma(z)}. 6456@texline @math{\ln \Gamma(z)}.
6463@infoline @expr{ln(gamma(z))}. 6457@infoline @expr{ln(gamma(z))}.
6464For large values of @expr{z}, it can be approximated by the infinite sum 6458For large values of @expr{z}, it can be approximated by the infinite sum
6465 6459
@@ -6478,7 +6472,7 @@ $$
6478 6472
6479@noindent 6473@noindent
6480where 6474where
6481@texline @tmath{\sum} 6475@texline @math{\sum}
6482@infoline @expr{sum} 6476@infoline @expr{sum}
6483represents the sum over @expr{n} from 1 to infinity 6477represents the sum over @expr{n} from 1 to infinity
6484(or to some limit high enough to give the desired accuracy), and 6478(or to some limit high enough to give the desired accuracy), and
@@ -6486,27 +6480,27 @@ the @code{bern} function produces (exact) Bernoulli numbers.
6486While this sum is not guaranteed to converge, in practice it is safe. 6480While this sum is not guaranteed to converge, in practice it is safe.
6487An interesting mathematical constant is Euler's gamma, which is equal 6481An interesting mathematical constant is Euler's gamma, which is equal
6488to about 0.5772. One way to compute it is by the formula, 6482to about 0.5772. One way to compute it is by the formula,
6489@texline @tmath{\gamma = -\psi(1)}. 6483@texline @math{\gamma = -\psi(1)}.
6490@infoline @expr{gamma = -psi(1)}. 6484@infoline @expr{gamma = -psi(1)}.
6491Unfortunately, 1 isn't a large enough argument 6485Unfortunately, 1 isn't a large enough argument
6492for the above formula to work (5 is a much safer value for @expr{z}). 6486for the above formula to work (5 is a much safer value for @expr{z}).
6493Fortunately, we can compute 6487Fortunately, we can compute
6494@texline @tmath{\psi(1)} 6488@texline @math{\psi(1)}
6495@infoline @expr{psi(1)} 6489@infoline @expr{psi(1)}
6496from 6490from
6497@texline @tmath{\psi(5)} 6491@texline @math{\psi(5)}
6498@infoline @expr{psi(5)} 6492@infoline @expr{psi(5)}
6499using the recurrence 6493using the recurrence
6500@texline @tmath{\psi(z+1) = \psi(z) + {1 \over z}}. 6494@texline @math{\psi(z+1) = \psi(z) + {1 \over z}}.
6501@infoline @expr{psi(z+1) = psi(z) + 1/z}. 6495@infoline @expr{psi(z+1) = psi(z) + 1/z}.
6502Your task: Develop a program to compute 6496Your task: Develop a program to compute
6503@texline @tmath{\psi(z)}; 6497@texline @math{\psi(z)};
6504@infoline @expr{psi(z)}; 6498@infoline @expr{psi(z)};
6505it should ``pump up'' @expr{z} 6499it should ``pump up'' @expr{z}
6506if necessary to be greater than 5, then use the above summation 6500if necessary to be greater than 5, then use the above summation
6507formula. Use looping commands to compute the sum. Use your function 6501formula. Use looping commands to compute the sum. Use your function
6508to compute 6502to compute
6509@texline @tmath{\gamma} 6503@texline @math{\gamma}
6510@infoline @expr{gamma} 6504@infoline @expr{gamma}
6511to twelve decimal places. (Calc has a built-in command 6505to twelve decimal places. (Calc has a built-in command
6512for Euler's constant, @kbd{I P}, which you can use to check your answer.) 6506for Euler's constant, @kbd{I P}, which you can use to check your answer.)
@@ -6683,18 +6677,18 @@ This section includes answers to all the exercises in the Calc tutorial.
6683@kbd{1 @key{RET} 2 @key{RET} 3 @key{RET} 4 + * -} 6677@kbd{1 @key{RET} 2 @key{RET} 3 @key{RET} 4 + * -}
6684 6678
6685The result is 6679The result is
6686@texline @tmath{1 - (2 \times (3 + 4)) = -13}. 6680@texline @math{1 - (2 \times (3 + 4)) = -13}.
6687@infoline @expr{1 - (2 * (3 + 4)) = -13}. 6681@infoline @expr{1 - (2 * (3 + 4)) = -13}.
6688 6682
6689@node RPN Answer 2, RPN Answer 3, RPN Answer 1, Answers to Exercises 6683@node RPN Answer 2, RPN Answer 3, RPN Answer 1, Answers to Exercises
6690@subsection RPN Tutorial Exercise 2 6684@subsection RPN Tutorial Exercise 2
6691 6685
6692@noindent 6686@noindent
6693@texline @tmath{2\times4 + 7\times9.5 + {5\over4} = 75.75} 6687@texline @math{2\times4 + 7\times9.5 + {5\over4} = 75.75}
6694@infoline @expr{2*4 + 7*9.5 + 5/4 = 75.75} 6688@infoline @expr{2*4 + 7*9.5 + 5/4 = 75.75}
6695 6689
6696After computing the intermediate term 6690After computing the intermediate term
6697@texline @tmath{2\times4 = 8}, 6691@texline @math{2\times4 = 8},
6698@infoline @expr{2*4 = 8}, 6692@infoline @expr{2*4 = 8},
6699you can leave that result on the stack while you compute the second 6693you can leave that result on the stack while you compute the second
6700term. With both of these results waiting on the stack you can then 6694term. With both of these results waiting on the stack you can then
@@ -6845,7 +6839,7 @@ the result will be zero because Calc uses the general rule that ``zero
6845times anything is zero.'' 6839times anything is zero.''
6846 6840
6847@c [fix-ref Infinities] 6841@c [fix-ref Infinities]
6848The @kbd{m i} command enables an @dfn{infinite mode} in which @expr{1 / 0} 6842The @kbd{m i} command enables an @dfn{Infinite mode} in which @expr{1 / 0}
6849results in a special symbol that represents ``infinity.'' If you 6843results in a special symbol that represents ``infinity.'' If you
6850multiply infinity by zero, Calc uses another special new symbol to 6844multiply infinity by zero, Calc uses another special new symbol to
6851show that the answer is ``indeterminate.'' @xref{Infinities}, for 6845show that the answer is ``indeterminate.'' @xref{Infinities}, for
@@ -7003,13 +6997,13 @@ give a floating-point result that is inaccurate even when rounded
7003down to an integer. Consider @expr{123456789 / 2} when the current 6997down to an integer. Consider @expr{123456789 / 2} when the current
7004precision is 6 digits. The true answer is @expr{61728394.5}, but 6998precision is 6 digits. The true answer is @expr{61728394.5}, but
7005with a precision of 6 this will be rounded to 6999with a precision of 6 this will be rounded to
7006@texline @tmath{12345700.0/2.0 = 61728500.0}. 7000@texline @math{12345700.0/2.0 = 61728500.0}.
7007@infoline @expr{12345700.@: / 2.@: = 61728500.}. 7001@infoline @expr{12345700.@: / 2.@: = 61728500.}.
7008The result, when converted to an integer, will be off by 106. 7002The result, when converted to an integer, will be off by 106.
7009 7003
7010Here are two solutions: Raise the precision enough that the 7004Here are two solutions: Raise the precision enough that the
7011floating-point round-off error is strictly to the right of the 7005floating-point round-off error is strictly to the right of the
7012decimal point. Or, convert to fraction mode so that @expr{123456789 / 2} 7006decimal point. Or, convert to Fraction mode so that @expr{123456789 / 2}
7013produces the exact fraction @expr{123456789:2}, which can be rounded 7007produces the exact fraction @expr{123456789:2}, which can be rounded
7014down by the @kbd{F} command without ever switching to floating-point 7008down by the @kbd{F} command without ever switching to floating-point
7015format. 7009format.
@@ -7022,9 +7016,9 @@ format.
7022does a floating-point calculation instead and produces @expr{1.5}. 7016does a floating-point calculation instead and produces @expr{1.5}.
7023 7017
7024Calc will find an exact result for a logarithm if the result is an integer 7018Calc will find an exact result for a logarithm if the result is an integer
7025or the reciprocal of an integer. But there is no efficient way to search 7019or (when in Fraction mode) the reciprocal of an integer. But there is
7026the space of all possible rational numbers for an exact answer, so Calc 7020no efficient way to search the space of all possible rational numbers
7027doesn't try. 7021for an exact answer, so Calc doesn't try.
7028 7022
7029@node Vector Answer 1, Vector Answer 2, Arithmetic Answer 2, Answers to Exercises 7023@node Vector Answer 1, Vector Answer 2, Arithmetic Answer 2, Answers to Exercises
7030@subsection Vector Tutorial Exercise 1 7024@subsection Vector Tutorial Exercise 1
@@ -7096,7 +7090,7 @@ matrix as usual.
7096@end group 7090@end group
7097@end smallexample 7091@end smallexample
7098 7092
7099This can be made more readable using @kbd{d B} to enable ``big'' display 7093This can be made more readable using @kbd{d B} to enable Big display
7100mode: 7094mode:
7101 7095
7102@smallexample 7096@smallexample
@@ -7107,23 +7101,23 @@ mode:
7107@end group 7101@end group
7108@end smallexample 7102@end smallexample
7109 7103
7110Type @kbd{d N} to return to ``normal'' display mode afterwards. 7104Type @kbd{d N} to return to Normal display mode afterwards.
7111 7105
7112@node Matrix Answer 3, List Answer 1, Matrix Answer 2, Answers to Exercises 7106@node Matrix Answer 3, List Answer 1, Matrix Answer 2, Answers to Exercises
7113@subsection Matrix Tutorial Exercise 3 7107@subsection Matrix Tutorial Exercise 3
7114 7108
7115@noindent 7109@noindent
7116To solve 7110To solve
7117@texline @tmath{A^T A \, X = A^T B}, 7111@texline @math{A^T A \, X = A^T B},
7118@infoline @expr{trn(A) * A * X = trn(A) * B}, 7112@infoline @expr{trn(A) * A * X = trn(A) * B},
7119first we compute 7113first we compute
7120@texline @tmath{A' = A^T A} 7114@texline @math{A' = A^T A}
7121@infoline @expr{A2 = trn(A) * A} 7115@infoline @expr{A2 = trn(A) * A}
7122and 7116and
7123@texline @tmath{B' = A^T B}; 7117@texline @math{B' = A^T B};
7124@infoline @expr{B2 = trn(A) * B}; 7118@infoline @expr{B2 = trn(A) * B};
7125now, we have a system 7119now, we have a system
7126@texline @tmath{A' X = B'} 7120@texline @math{A' X = B'}
7127@infoline @expr{A2 * X = B2} 7121@infoline @expr{A2 * X = B2}
7128which we can solve using Calc's @samp{/} command. 7122which we can solve using Calc's @samp{/} command.
7129 7123
@@ -7155,7 +7149,7 @@ $$
7155 7149
7156The first step is to enter the coefficient matrix. We'll store it in 7150The first step is to enter the coefficient matrix. We'll store it in
7157quick variable number 7 for later reference. Next, we compute the 7151quick variable number 7 for later reference. Next, we compute the
7158@texline @tmath{B'} 7152@texline @math{B'}
7159@infoline @expr{B2} 7153@infoline @expr{B2}
7160vector. 7154vector.
7161 7155
@@ -7173,7 +7167,7 @@ vector.
7173 7167
7174@noindent 7168@noindent
7175Now we compute the matrix 7169Now we compute the matrix
7176@texline @tmath{A'} 7170@texline @math{A'}
7177@infoline @expr{A2} 7171@infoline @expr{A2}
7178and divide. 7172and divide.
7179 7173
@@ -7194,16 +7188,16 @@ and divide.
7194round-off error.) 7188round-off error.)
7195 7189
7196Notice that the answers are similar to those for the 7190Notice that the answers are similar to those for the
7197@texline @tmath{3\times3} 7191@texline @math{3\times3}
7198@infoline 3x3 7192@infoline 3x3
7199system solved in the text. That's because the fourth equation that was 7193system solved in the text. That's because the fourth equation that was
7200added to the system is almost identical to the first one multiplied 7194added to the system is almost identical to the first one multiplied
7201by two. (If it were identical, we would have gotten the exact same 7195by two. (If it were identical, we would have gotten the exact same
7202answer since the 7196answer since the
7203@texline @tmath{4\times3} 7197@texline @math{4\times3}
7204@infoline 4x3 7198@infoline 4x3
7205system would be equivalent to the original 7199system would be equivalent to the original
7206@texline @tmath{3\times3} 7200@texline @math{3\times3}
7207@infoline 3x3 7201@infoline 3x3
7208system.) 7202system.)
7209 7203
@@ -7280,7 +7274,7 @@ $$ m \times x + b \times 1 = y $$
7280@end tex 7274@end tex
7281 7275
7282Thus we want a 7276Thus we want a
7283@texline @tmath{19\times2} 7277@texline @math{19\times2}
7284@infoline 19x2 7278@infoline 19x2
7285matrix with our @expr{x} vector as one column and 7279matrix with our @expr{x} vector as one column and
7286ones as the other column. So, first we build the column of ones, then 7280ones as the other column. So, first we build the column of ones, then
@@ -7299,10 +7293,10 @@ we combine the two columns to form our @expr{A} matrix.
7299 7293
7300@noindent 7294@noindent
7301Now we compute 7295Now we compute
7302@texline @tmath{A^T y} 7296@texline @math{A^T y}
7303@infoline @expr{trn(A) * y} 7297@infoline @expr{trn(A) * y}
7304and 7298and
7305@texline @tmath{A^T A} 7299@texline @math{A^T A}
7306@infoline @expr{trn(A) * A} 7300@infoline @expr{trn(A) * A}
7307and divide. 7301and divide.
7308 7302
@@ -7330,7 +7324,7 @@ and divide.
7330@end smallexample 7324@end smallexample
7331 7325
7332Since we were solving equations of the form 7326Since we were solving equations of the form
7333@texline @tmath{m \times x + b \times 1 = y}, 7327@texline @math{m \times x + b \times 1 = y},
7334@infoline @expr{m*x + b*1 = y}, 7328@infoline @expr{m*x + b*1 = y},
7335these numbers should be @expr{m} and @expr{b}, respectively. Sure 7329these numbers should be @expr{m} and @expr{b}, respectively. Sure
7336enough, they agree exactly with the result computed using @kbd{V M} and 7330enough, they agree exactly with the result computed using @kbd{V M} and
@@ -7393,7 +7387,7 @@ then raise the number to that power.)
7393 7387
7394@noindent 7388@noindent
7395A number @expr{j} is a divisor of @expr{n} if 7389A number @expr{j} is a divisor of @expr{n} if
7396@texline @tmath{n \mathbin{\hbox{\code{\%}}} j = 0}. 7390@texline @math{n \mathbin{\hbox{\code{\%}}} j = 0}.
7397@infoline @samp{n % j = 0}. 7391@infoline @samp{n % j = 0}.
7398The first step is to get a vector that identifies the divisors. 7392The first step is to get a vector that identifies the divisors.
7399 7393
@@ -7464,7 +7458,7 @@ zero, so adding zeros on the left and right is safe. From then on
7464the job is pretty straightforward. 7458the job is pretty straightforward.
7465 7459
7466Incidentally, Calc provides the 7460Incidentally, Calc provides the
7467@texline @dfn{M@"obius} @tmath{\mu} 7461@texline @dfn{M@"obius} @math{\mu}
7468@infoline @dfn{Moebius mu} 7462@infoline @dfn{Moebius mu}
7469function which is zero if and only if its argument is square-free. It 7463function which is zero if and only if its argument is square-free. It
7470would be a much more convenient way to do the above test in practice. 7464would be a much more convenient way to do the above test in practice.
@@ -7498,7 +7492,7 @@ The numbers down the lefthand edge of the list we desire are called
7498the ``triangular numbers'' (now you know why!). The @expr{n}th 7492the ``triangular numbers'' (now you know why!). The @expr{n}th
7499triangular number is the sum of the integers from 1 to @expr{n}, and 7493triangular number is the sum of the integers from 1 to @expr{n}, and
7500can be computed directly by the formula 7494can be computed directly by the formula
7501@texline @tmath{n (n+1) \over 2}. 7495@texline @math{n (n+1) \over 2}.
7502@infoline @expr{n * (n+1) / 2}. 7496@infoline @expr{n * (n+1) / 2}.
7503 7497
7504@smallexample 7498@smallexample
@@ -7594,7 +7588,7 @@ A way to isolate the maximum value is to compute the maximum using
7594@noindent 7588@noindent
7595It's a good idea to verify, as in the last step above, that only 7589It's a good idea to verify, as in the last step above, that only
7596one value is equal to the maximum. (After all, a plot of 7590one value is equal to the maximum. (After all, a plot of
7597@texline @tmath{\sin x} 7591@texline @math{\sin x}
7598@infoline @expr{sin(x)} 7592@infoline @expr{sin(x)}
7599might have many points all equal to the maximum value, 1.) 7593might have many points all equal to the maximum value, 1.)
7600 7594
@@ -7866,10 +7860,10 @@ This problem can be made a lot easier by taking advantage of some
7866symmetries. First of all, after some thought it's clear that the 7860symmetries. First of all, after some thought it's clear that the
7867@expr{y} axis can be ignored altogether. Just pick a random @expr{x} 7861@expr{y} axis can be ignored altogether. Just pick a random @expr{x}
7868component for one end of the match, pick a random direction 7862component for one end of the match, pick a random direction
7869@texline @tmath{\theta}, 7863@texline @math{\theta},
7870@infoline @expr{theta}, 7864@infoline @expr{theta},
7871and see if @expr{x} and 7865and see if @expr{x} and
7872@texline @tmath{x + \cos \theta} 7866@texline @math{x + \cos \theta}
7873@infoline @expr{x + cos(theta)} 7867@infoline @expr{x + cos(theta)}
7874(which is the @expr{x} coordinate of the other endpoint) cross a line. 7868(which is the @expr{x} coordinate of the other endpoint) cross a line.
7875The lines are at integer coordinates, so this happens when the two 7869The lines are at integer coordinates, so this happens when the two
@@ -7886,10 +7880,10 @@ coordinates 0 and 1 for the lines on either side of the leftmost
7886endpoint. The rightmost endpoint will be between 0 and 1 if the 7880endpoint. The rightmost endpoint will be between 0 and 1 if the
7887match does not cross a line, or between 1 and 2 if it does. So: 7881match does not cross a line, or between 1 and 2 if it does. So:
7888Pick random @expr{x} and 7882Pick random @expr{x} and
7889@texline @tmath{\theta}, 7883@texline @math{\theta},
7890@infoline @expr{theta}, 7884@infoline @expr{theta},
7891compute 7885compute
7892@texline @tmath{x + \cos \theta}, 7886@texline @math{x + \cos \theta},
7893@infoline @expr{x + cos(theta)}, 7887@infoline @expr{x + cos(theta)},
7894and count how many of the results are greater than one. Simple! 7888and count how many of the results are greater than one. Simple!
7895 7889
@@ -8214,7 +8208,7 @@ precision slightly and try again:
8214@noindent 8208@noindent
8215Aha! It's unlikely that an irrational number would equal a fraction 8209Aha! It's unlikely that an irrational number would equal a fraction
8216this simple to within ten digits, so our original number was probably 8210this simple to within ten digits, so our original number was probably
8217@texline @tmath{\sqrt{27 \pi / 53}}. 8211@texline @math{\sqrt{27 \pi / 53}}.
8218@infoline @expr{sqrt(27 pi / 53)}. 8212@infoline @expr{sqrt(27 pi / 53)}.
8219 8213
8220Notice that we didn't need to re-round the number when we reduced the 8214Notice that we didn't need to re-round the number when we reduced the
@@ -8254,7 +8248,7 @@ so it settles for the conservative answer @code{uinf}.
8254 8248
8255@samp{ln(0) = -inf}. Here we have an infinite answer to a finite 8249@samp{ln(0) = -inf}. Here we have an infinite answer to a finite
8256input. As in the @expr{1 / 0} case, Calc will only use infinities 8250input. As in the @expr{1 / 0} case, Calc will only use infinities
8257here if you have turned on ``infinite'' mode. Otherwise, it will 8251here if you have turned on Infinite mode. Otherwise, it will
8258treat @samp{ln(0)} as an error. 8252treat @samp{ln(0)} as an error.
8259 8253
8260@node Types Answer 3, Types Answer 4, Types Answer 2, Answers to Exercises 8254@node Types Answer 3, Types Answer 4, Types Answer 2, Answers to Exercises
@@ -8468,16 +8462,16 @@ Calc normally treats division by zero as an error, so that the formula
8468@w{@samp{1 / [0 .. 10]}}, also (potentially) divides by zero because zero 8462@w{@samp{1 / [0 .. 10]}}, also (potentially) divides by zero because zero
8469is now a member of the interval. So Calc leaves this one unevaluated, too. 8463is now a member of the interval. So Calc leaves this one unevaluated, too.
8470 8464
8471If you turn on ``infinite'' mode by pressing @kbd{m i}, you will 8465If you turn on Infinite mode by pressing @kbd{m i}, you will
8472instead get the answer @samp{[0.1 .. inf]}, which includes infinity 8466instead get the answer @samp{[0.1 .. inf]}, which includes infinity
8473as a possible value. 8467as a possible value.
8474 8468
8475The fourth calculation, @samp{1 / (-10 .. 10)}, has the same problem. 8469The fourth calculation, @samp{1 / (-10 .. 10)}, has the same problem.
8476Zero is buried inside the interval, but it's still a possible value. 8470Zero is buried inside the interval, but it's still a possible value.
8477It's not hard to see that the actual result of @samp{1 / (-10 .. 10)} 8471It's not hard to see that the actual result of @samp{1 / (-10 .. 10)}
8478will be either greater than @i{0.1}, or less than @i{-0.1}. Thus 8472will be either greater than @mathit{0.1}, or less than @mathit{-0.1}. Thus
8479the interval goes from minus infinity to plus infinity, with a ``hole'' 8473the interval goes from minus infinity to plus infinity, with a ``hole''
8480in it from @i{-0.1} to @i{0.1}. Calc doesn't have any way to 8474in it from @mathit{-0.1} to @mathit{0.1}. Calc doesn't have any way to
8481represent this, so it just reports @samp{[-inf .. inf]} as the answer. 8475represent this, so it just reports @samp{[-inf .. inf]} as the answer.
8482It may be disappointing to hear ``the answer lies somewhere between 8476It may be disappointing to hear ``the answer lies somewhere between
8483minus infinity and plus infinity, inclusive,'' but that's the best 8477minus infinity and plus infinity, inclusive,'' but that's the best
@@ -8497,9 +8491,9 @@ that interval arithmetic can do in this case.
8497@end smallexample 8491@end smallexample
8498 8492
8499@noindent 8493@noindent
8500In the first case the result says, ``if a number is between @i{-3} and 8494In the first case the result says, ``if a number is between @mathit{-3} and
85013, its square is between 0 and 9.'' The second case says, ``the product 84953, its square is between 0 and 9.'' The second case says, ``the product
8502of two numbers each between @i{-3} and 3 is between @i{-9} and 9.'' 8496of two numbers each between @mathit{-3} and 3 is between @mathit{-9} and 9.''
8503 8497
8504An interval form is not a number; it is a symbol that can stand for 8498An interval form is not a number; it is a symbol that can stand for
8505many different numbers. Two identical-looking interval forms can stand 8499many different numbers. Two identical-looking interval forms can stand
@@ -9131,7 +9125,7 @@ But then:
9131@end group 9125@end group
9132@end smallexample 9126@end smallexample
9133 9127
9134Perhaps more surprisingly, this rule still works with infinite mode 9128Perhaps more surprisingly, this rule still works with Infinite mode
9135turned on. Calc tries @code{EvalRules} before any built-in rules for 9129turned on. Calc tries @code{EvalRules} before any built-in rules for
9136a function. This allows you to override the default behavior of any 9130a function. This allows you to override the default behavior of any
9137Calc feature: Even though Calc now wants to evaluate @expr{0^0} to 9131Calc feature: Even though Calc now wants to evaluate @expr{0^0} to
@@ -9255,7 +9249,7 @@ algebraic entry, whichever way you prefer:
9255 9249
9256@noindent 9250@noindent
9257Computing 9251Computing
9258@texline @tmath{\displaystyle{\sin x \over x}}: 9252@texline @math{\displaystyle{\sin x \over x}}:
9259@infoline @expr{sin(x) / x}: 9253@infoline @expr{sin(x) / x}:
9260 9254
9261Using the stack: @kbd{C-x ( @key{RET} S @key{TAB} / C-x )}. 9255Using the stack: @kbd{C-x ( @key{RET} S @key{TAB} / C-x )}.
@@ -9326,7 +9320,7 @@ C-x ( ' [0, 1; 1, 1] ^ ($-1) * [1, 1] @key{RET} v u @key{DEL} C-x )
9326@noindent 9320@noindent
9327This program is quite efficient because Calc knows how to raise a 9321This program is quite efficient because Calc knows how to raise a
9328matrix (or other value) to the power @expr{n} in only 9322matrix (or other value) to the power @expr{n} in only
9329@texline @tmath{\log_2 n} 9323@texline @math{\log_2 n}
9330@infoline @expr{log(n,2)} 9324@infoline @expr{log(n,2)}
9331steps. For example, this program can compute the 1000th Fibonacci 9325steps. For example, this program can compute the 1000th Fibonacci
9332number (a 209-digit integer!) in about 10 steps; even though the 9326number (a 209-digit integer!) in about 10 steps; even though the
@@ -9380,7 +9374,7 @@ harmonic number is 4.02.
9380@noindent 9374@noindent
9381The first step is to compute the derivative @expr{f'(x)} and thus 9375The first step is to compute the derivative @expr{f'(x)} and thus
9382the formula 9376the formula
9383@texline @tmath{\displaystyle{x - {f(x) \over f'(x)}}}. 9377@texline @math{\displaystyle{x - {f(x) \over f'(x)}}}.
9384@infoline @expr{x - f(x)/f'(x)}. 9378@infoline @expr{x - f(x)/f'(x)}.
9385 9379
9386(Because this definition is long, it will be repeated in concise form 9380(Because this definition is long, it will be repeated in concise form
@@ -9497,10 +9491,10 @@ method (among others) to look for numerical solutions to any equation.
9497The first step is to adjust @expr{z} to be greater than 5. A simple 9491The first step is to adjust @expr{z} to be greater than 5. A simple
9498``for'' loop will do the job here. If @expr{z} is less than 5, we 9492``for'' loop will do the job here. If @expr{z} is less than 5, we
9499reduce the problem using 9493reduce the problem using
9500@texline @tmath{\psi(z) = \psi(z+1) - 1/z}. 9494@texline @math{\psi(z) = \psi(z+1) - 1/z}.
9501@infoline @expr{psi(z) = psi(z+1) - 1/z}. We go 9495@infoline @expr{psi(z) = psi(z+1) - 1/z}. We go
9502on to compute 9496on to compute
9503@texline @tmath{\psi(z+1)}, 9497@texline @math{\psi(z+1)},
9504@infoline @expr{psi(z+1)}, 9498@infoline @expr{psi(z+1)},
9505and remember to add back a factor of @expr{-1/z} when we're done. This 9499and remember to add back a factor of @expr{-1/z} when we're done. This
9506step is repeated until @expr{z > 5}. 9500step is repeated until @expr{z > 5}.
@@ -9541,7 +9535,7 @@ are exactly equal, not just equal to within the current precision.)
9541@end smallexample 9535@end smallexample
9542 9536
9543Now we compute the initial part of the sum: 9537Now we compute the initial part of the sum:
9544@texline @tmath{\ln z - {1 \over 2z}} 9538@texline @math{\ln z - {1 \over 2z}}
9545@infoline @expr{ln(z) - 1/2z} 9539@infoline @expr{ln(z) - 1/2z}
9546minus the adjustment factor. 9540minus the adjustment factor.
9547 9541
@@ -9584,7 +9578,7 @@ up the value of @expr{2 n}. (Calc does have a summation command,
9584@end smallexample 9578@end smallexample
9585 9579
9586This is the value of 9580This is the value of
9587@texline @tmath{-\gamma}, 9581@texline @math{-\gamma},
9588@infoline @expr{- gamma}, 9582@infoline @expr{- gamma},
9589with a slight bit of roundoff error. To get a full 12 digits, let's use 9583with a slight bit of roundoff error. To get a full 12 digits, let's use
9590a higher precision: 9584a higher precision:
@@ -9619,7 +9613,7 @@ C-x )
9619@noindent 9613@noindent
9620Taking the derivative of a term of the form @expr{x^n} will produce 9614Taking the derivative of a term of the form @expr{x^n} will produce
9621a term like 9615a term like
9622@texline @tmath{n x^{n-1}}. 9616@texline @math{n x^{n-1}}.
9623@infoline @expr{n x^(n-1)}. 9617@infoline @expr{n x^(n-1)}.
9624Taking the derivative of a constant 9618Taking the derivative of a constant
9625produces zero. From this it is easy to see that the @expr{n}th 9619produces zero. From this it is easy to see that the @expr{n}th
@@ -9896,10 +9890,10 @@ By default this creates a pair of small windows, @samp{*Calculator*}
9896and @samp{*Calc Trail*}. The former displays the contents of the 9890and @samp{*Calc Trail*}. The former displays the contents of the
9897Calculator stack and is manipulated exclusively through Calc commands. 9891Calculator stack and is manipulated exclusively through Calc commands.
9898It is possible (though not usually necessary) to create several Calc 9892It is possible (though not usually necessary) to create several Calc
9899Mode buffers each of which has an independent stack, undo list, and 9893mode buffers each of which has an independent stack, undo list, and
9900mode settings. There is exactly one Calc Trail buffer; it records a 9894mode settings. There is exactly one Calc Trail buffer; it records a
9901list of the results of all calculations that have been done. The 9895list of the results of all calculations that have been done. The
9902Calc Trail buffer uses a variant of Calc Mode, so Calculator commands 9896Calc Trail buffer uses a variant of Calc mode, so Calculator commands
9903still work when the trail buffer's window is selected. It is possible 9897still work when the trail buffer's window is selected. It is possible
9904to turn the trail window off, but the @samp{*Calc Trail*} buffer itself 9898to turn the trail window off, but the @samp{*Calc Trail*} buffer itself
9905still exists and is updated silently. @xref{Trail Commands}. 9899still exists and is updated silently. @xref{Trail Commands}.
@@ -9913,7 +9907,7 @@ still exists and is updated silently. @xref{Trail Commands}.
9913In most installations, the @kbd{M-# c} key sequence is a more 9907In most installations, the @kbd{M-# c} key sequence is a more
9914convenient way to start the Calculator. Also, @kbd{M-# M-#} and 9908convenient way to start the Calculator. Also, @kbd{M-# M-#} and
9915@kbd{M-# #} are synonyms for @kbd{M-# c} unless you last used Calc 9909@kbd{M-# #} are synonyms for @kbd{M-# c} unless you last used Calc
9916in its ``keypad'' mode. 9910in its Keypad mode.
9917 9911
9918@kindex x 9912@kindex x
9919@kindex M-x 9913@kindex M-x
@@ -9985,7 +9979,7 @@ the keys with the mouse to operate the calculator. @xref{Keypad Mode}.
9985@pindex calc-quit 9979@pindex calc-quit
9986@cindex Quitting the Calculator 9980@cindex Quitting the Calculator
9987@cindex Exiting the Calculator 9981@cindex Exiting the Calculator
9988The @kbd{q} key (@code{calc-quit}) exits Calc Mode and closes the 9982The @kbd{q} key (@code{calc-quit}) exits Calc mode and closes the
9989Calculator's window(s). It does not delete the Calculator buffers. 9983Calculator's window(s). It does not delete the Calculator buffers.
9990If you type @kbd{M-x calc} again, the Calculator will reappear with the 9984If you type @kbd{M-x calc} again, the Calculator will reappear with the
9991contents of the stack intact. Typing @kbd{M-# c} or @kbd{M-# M-#} 9985contents of the stack intact. Typing @kbd{M-# c} or @kbd{M-# M-#}
@@ -10193,7 +10187,7 @@ The first three keystrokes ``push'' the numbers 1 and 2 onto the stack. The
10193@kbd{+} key always ``pops'' the top two numbers from the stack, adds them, 10187@kbd{+} key always ``pops'' the top two numbers from the stack, adds them,
10194and pushes the result (3) back onto the stack. This number is ready for 10188and pushes the result (3) back onto the stack. This number is ready for
10195further calculations: @kbd{5 -} pushes 5 onto the stack, then pops the 10189further calculations: @kbd{5 -} pushes 5 onto the stack, then pops the
101963 and 5, subtracts them, and pushes the result (@i{-2}). 101903 and 5, subtracts them, and pushes the result (@mathit{-2}).
10197 10191
10198Note that the ``top'' of the stack actually appears at the @emph{bottom} 10192Note that the ``top'' of the stack actually appears at the @emph{bottom}
10199of the buffer. A line containing a single @samp{.} character signifies 10193of the buffer. A line containing a single @samp{.} character signifies
@@ -10256,7 +10250,7 @@ the two numbers on the top of the stack. The @kbd{n} key changes the sign
10256of the number on the top of the stack or the number currently being entered. 10250of the number on the top of the stack or the number currently being entered.
10257The @kbd{_} key begins entry of a negative number or changes the sign of 10251The @kbd{_} key begins entry of a negative number or changes the sign of
10258the number currently being entered. The following sequences all enter the 10252the number currently being entered. The following sequences all enter the
10259number @i{-5} onto the stack: @kbd{0 @key{RET} 5 -}, @kbd{5 n @key{RET}}, 10253number @mathit{-5} onto the stack: @kbd{0 @key{RET} 5 -}, @kbd{5 n @key{RET}},
10260@kbd{5 @key{RET} n}, @kbd{_ 5 @key{RET}}, @kbd{5 _ @key{RET}}. 10254@kbd{5 @key{RET} n}, @kbd{_ 5 @key{RET}}, @kbd{5 _ @key{RET}}.
10261 10255
10262Some other keys are active during numeric entry, such as @kbd{#} for 10256Some other keys are active during numeric entry, such as @kbd{#} for
@@ -10277,7 +10271,7 @@ During numeric entry, the only editing key available is @key{DEL}.
10277Calculations can also be entered in algebraic form. This is accomplished 10271Calculations can also be entered in algebraic form. This is accomplished
10278by typing the apostrophe key, @kbd{'}, followed by the expression in 10272by typing the apostrophe key, @kbd{'}, followed by the expression in
10279standard format: @kbd{@key{'} 2+3*4 @key{RET}} computes 10273standard format: @kbd{@key{'} 2+3*4 @key{RET}} computes
10280@texline @tmath{2+(3\times4) = 14} 10274@texline @math{2+(3\times4) = 14}
10281@infoline @expr{2+(3*4) = 14} 10275@infoline @expr{2+(3*4) = 14}
10282and pushes that on the stack. If you wish you can 10276and pushes that on the stack. If you wish you can
10283ignore the RPN aspect of Calc altogether and simply enter algebraic 10277ignore the RPN aspect of Calc altogether and simply enter algebraic
@@ -10285,7 +10279,7 @@ expressions in this way. You may want to use @key{DEL} every so often to
10285clear previous results off the stack. 10279clear previous results off the stack.
10286 10280
10287You can press the apostrophe key during normal numeric entry to switch 10281You can press the apostrophe key during normal numeric entry to switch
10288the half-entered number into algebraic entry mode. One reason to do this 10282the half-entered number into Algebraic entry mode. One reason to do this
10289would be to use the full Emacs cursor motion and editing keys, which are 10283would be to use the full Emacs cursor motion and editing keys, which are
10290available during algebraic entry but not during numeric entry. 10284available during algebraic entry but not during numeric entry.
10291 10285
@@ -10296,7 +10290,7 @@ you complete your half-finished entry in a separate buffer.
10296 10290
10297@kindex m a 10291@kindex m a
10298@pindex calc-algebraic-mode 10292@pindex calc-algebraic-mode
10299@cindex Algebraic mode 10293@cindex Algebraic Mode
10300If you prefer algebraic entry, you can use the command @kbd{m a} 10294If you prefer algebraic entry, you can use the command @kbd{m a}
10301(@code{calc-algebraic-mode}) to set Algebraic mode. In this mode, 10295(@code{calc-algebraic-mode}) to set Algebraic mode. In this mode,
10302digits and other keys that would normally start numeric entry instead 10296digits and other keys that would normally start numeric entry instead
@@ -10307,7 +10301,7 @@ but you will have to press @key{RET} to terminate every number:
10307@kbd{2 @key{RET} 3 @key{RET} * 4 @key{RET} +} would accomplish the same 10301@kbd{2 @key{RET} 3 @key{RET} * 4 @key{RET} +} would accomplish the same
10308thing as @kbd{2*3+4 @key{RET}}. 10302thing as @kbd{2*3+4 @key{RET}}.
10309 10303
10310@cindex Incomplete algebraic mode 10304@cindex Incomplete Algebraic Mode
10311If you give a numeric prefix argument like @kbd{C-u} to the @kbd{m a} 10305If you give a numeric prefix argument like @kbd{C-u} to the @kbd{m a}
10312command, it enables Incomplete Algebraic mode; this is like regular 10306command, it enables Incomplete Algebraic mode; this is like regular
10313Algebraic mode except that it applies to the @kbd{(} and @kbd{[} keys 10307Algebraic mode except that it applies to the @kbd{(} and @kbd{[} keys
@@ -10315,15 +10309,15 @@ only. Numeric keys still begin a numeric entry in this mode.
10315 10309
10316@kindex m t 10310@kindex m t
10317@pindex calc-total-algebraic-mode 10311@pindex calc-total-algebraic-mode
10318@cindex Total algebraic mode 10312@cindex Total Algebraic Mode
10319The @kbd{m t} (@code{calc-total-algebraic-mode}) gives you an even 10313The @kbd{m t} (@code{calc-total-algebraic-mode}) gives you an even
10320stronger algebraic-entry mode, in which @emph{all} regular letter and 10314stronger algebraic-entry mode, in which @emph{all} regular letter and
10321punctuation keys begin algebraic entry. Use this if you prefer typing 10315punctuation keys begin algebraic entry. Use this if you prefer typing
10322@w{@kbd{sqrt( )}} instead of @kbd{Q}, @w{@kbd{factor( )}} instead of 10316@w{@kbd{sqrt( )}} instead of @kbd{Q}, @w{@kbd{factor( )}} instead of
10323@kbd{a f}, and so on. To type regular Calc commands when you are in 10317@kbd{a f}, and so on. To type regular Calc commands when you are in
10324``total'' algebraic mode, hold down the @key{META} key. Thus @kbd{M-q} 10318Total Algebraic mode, hold down the @key{META} key. Thus @kbd{M-q}
10325is the command to quit Calc, @kbd{M-p} sets the precision, and 10319is the command to quit Calc, @kbd{M-p} sets the precision, and
10326@kbd{M-m t} (or @kbd{M-m M-t}, if you prefer) turns total algebraic 10320@kbd{M-m t} (or @kbd{M-m M-t}, if you prefer) turns Total Algebraic
10327mode back off again. Meta keys also terminate algebraic entry, so 10321mode back off again. Meta keys also terminate algebraic entry, so
10328that @kbd{2+3 M-S} is equivalent to @kbd{2+3 @key{RET} M-S}. The symbol 10322that @kbd{2+3 M-S} is equivalent to @kbd{2+3 @key{RET} M-S}. The symbol
10329@samp{Alg*} will appear in the mode line whenever you are in this mode. 10323@samp{Alg*} will appear in the mode line whenever you are in this mode.
@@ -10584,7 +10578,7 @@ that you must always press @kbd{w} yourself to see the messages).
10584 10578
10585@noindent 10579@noindent
10586@pindex another-calc 10580@pindex another-calc
10587It is possible to have any number of Calc Mode buffers at once. 10581It is possible to have any number of Calc mode buffers at once.
10588Usually this is done by executing @kbd{M-x another-calc}, which 10582Usually this is done by executing @kbd{M-x another-calc}, which
10589is similar to @kbd{M-# c} except that if a @samp{*Calculator*} 10583is similar to @kbd{M-# c} except that if a @samp{*Calculator*}
10590buffer already exists, a new, independent one with a name of the 10584buffer already exists, a new, independent one with a name of the
@@ -10687,7 +10681,7 @@ approximation. This value will not need to be recomputed ever again
10687unless you raise the precision still further. Many operations such as 10681unless you raise the precision still further. Many operations such as
10688logarithms and sines make use of similarly cached values such as 10682logarithms and sines make use of similarly cached values such as
10689@cpiover{4} and 10683@cpiover{4} and
10690@texline @tmath{\ln 2}. 10684@texline @math{\ln 2}.
10691@infoline @expr{ln(2)}. 10685@infoline @expr{ln(2)}.
10692The visible effect of caching is that 10686The visible effect of caching is that
10693high-precision computations may seem to do extra work the first time. 10687high-precision computations may seem to do extra work the first time.
@@ -10799,7 +10793,7 @@ The Calculator stores integers to arbitrary precision. Addition,
10799subtraction, and multiplication of integers always yields an exact 10793subtraction, and multiplication of integers always yields an exact
10800integer result. (If the result of a division or exponentiation of 10794integer result. (If the result of a division or exponentiation of
10801integers is not an integer, it is expressed in fractional or 10795integers is not an integer, it is expressed in fractional or
10802floating-point form according to the current Fraction Mode. 10796floating-point form according to the current Fraction mode.
10803@xref{Fraction Mode}.) 10797@xref{Fraction Mode}.)
10804 10798
10805A decimal integer is represented as an optional sign followed by a 10799A decimal integer is represented as an optional sign followed by a
@@ -10825,7 +10819,7 @@ A @dfn{fraction} is a ratio of two integers. Fractions are traditionally
10825written ``2/3'' but Calc uses the notation @samp{2:3}. (The @kbd{/} key 10819written ``2/3'' but Calc uses the notation @samp{2:3}. (The @kbd{/} key
10826performs RPN division; the following two sequences push the number 10820performs RPN division; the following two sequences push the number
10827@samp{2:3} on the stack: @kbd{2 :@: 3 @key{RET}}, or @kbd{2 @key{RET} 3 /} 10821@samp{2:3} on the stack: @kbd{2 :@: 3 @key{RET}}, or @kbd{2 @key{RET} 3 /}
10828assuming Fraction Mode has been enabled.) 10822assuming Fraction mode has been enabled.)
10829When the Calculator produces a fractional result it always reduces it to 10823When the Calculator produces a fractional result it always reduces it to
10830simplest form, which may in fact be an integer. 10824simplest form, which may in fact be an integer.
10831 10825
@@ -10846,10 +10840,10 @@ A floating-point number or @dfn{float} is a number stored in scientific
10846notation. The number of significant digits in the fractional part is 10840notation. The number of significant digits in the fractional part is
10847governed by the current floating precision (@pxref{Precision}). The 10841governed by the current floating precision (@pxref{Precision}). The
10848range of acceptable values is from 10842range of acceptable values is from
10849@texline @tmath{10^{-3999999}} 10843@texline @math{10^{-3999999}}
10850@infoline @expr{10^-3999999} 10844@infoline @expr{10^-3999999}
10851(inclusive) to 10845(inclusive) to
10852@texline @tmath{10^{4000000}} 10846@texline @math{10^{4000000}}
10853@infoline @expr{10^4000000} 10847@infoline @expr{10^4000000}
10854(exclusive), plus the corresponding negative values and zero. 10848(exclusive), plus the corresponding negative values and zero.
10855 10849
@@ -10921,16 +10915,16 @@ Rectangular complex numbers can also be displayed in @samp{@var{a}+@var{b}i}
10921notation; @pxref{Complex Formats}. 10915notation; @pxref{Complex Formats}.
10922 10916
10923Polar complex numbers are displayed in the form 10917Polar complex numbers are displayed in the form
10924@texline `@t{(}@var{r}@t{;}@tmath{\theta}@t{)}' 10918@texline `@t{(}@var{r}@t{;}@math{\theta}@t{)}'
10925@infoline `@t{(}@var{r}@t{;}@var{theta}@t{)}' 10919@infoline `@t{(}@var{r}@t{;}@var{theta}@t{)}'
10926where @var{r} is the nonnegative magnitude and 10920where @var{r} is the nonnegative magnitude and
10927@texline @tmath{\theta} 10921@texline @math{\theta}
10928@infoline @var{theta} 10922@infoline @var{theta}
10929is the argument or phase angle. The range of 10923is the argument or phase angle. The range of
10930@texline @tmath{\theta} 10924@texline @math{\theta}
10931@infoline @var{theta} 10925@infoline @var{theta}
10932depends on the current angular mode (@pxref{Angular Modes}); it is 10926depends on the current angular mode (@pxref{Angular Modes}); it is
10933generally between @i{-180} and @i{+180} degrees or the equivalent range 10927generally between @mathit{-180} and @mathit{+180} degrees or the equivalent range
10934in radians. 10928in radians.
10935 10929
10936Complex numbers are entered in stages using incomplete objects. 10930Complex numbers are entered in stages using incomplete objects.
@@ -10939,7 +10933,7 @@ Complex numbers are entered in stages using incomplete objects.
10939Operations on rectangular complex numbers yield rectangular complex 10933Operations on rectangular complex numbers yield rectangular complex
10940results, and similarly for polar complex numbers. Where the two types 10934results, and similarly for polar complex numbers. Where the two types
10941are mixed, or where new complex numbers arise (as for the square root of 10935are mixed, or where new complex numbers arise (as for the square root of
10942a negative real), the current @dfn{Polar Mode} is used to determine the 10936a negative real), the current @dfn{Polar mode} is used to determine the
10943type. @xref{Polar Mode}. 10937type. @xref{Polar Mode}.
10944 10938
10945A complex result in which the imaginary part is zero (or the phase angle 10939A complex result in which the imaginary part is zero (or the phase angle
@@ -10973,7 +10967,7 @@ larger, becomes arbitrarily close to zero. So you can imagine
10973that if @expr{x} got ``all the way to infinity,'' then @expr{1 / x} 10967that if @expr{x} got ``all the way to infinity,'' then @expr{1 / x}
10974would go all the way to zero. Similarly, when they say that 10968would go all the way to zero. Similarly, when they say that
10975@samp{exp(inf) = inf}, they mean that 10969@samp{exp(inf) = inf}, they mean that
10976@texline @tmath{e^x} 10970@texline @math{e^x}
10977@infoline @expr{exp(x)} 10971@infoline @expr{exp(x)}
10978grows without bound as @expr{x} grows. The symbol @samp{-inf} likewise 10972grows without bound as @expr{x} grows. The symbol @samp{-inf} likewise
10979stands for an infinitely negative real value; for example, we say that 10973stands for an infinitely negative real value; for example, we say that
@@ -11027,7 +11021,7 @@ infinity, it's just that @emph{which} number it stands for
11027cannot be determined.) In Calc's notation, @samp{0 * inf = nan} 11021cannot be determined.) In Calc's notation, @samp{0 * inf = nan}
11028and @samp{inf / inf = nan}. A few other common indeterminate 11022and @samp{inf / inf = nan}. A few other common indeterminate
11029expressions are @samp{inf - inf} and @samp{inf ^ 0}. Also, 11023expressions are @samp{inf - inf} and @samp{inf ^ 0}. Also,
11030@samp{0 / 0 = nan} if you have turned on ``infinite mode'' 11024@samp{0 / 0 = nan} if you have turned on Infinite mode
11031(as described above). 11025(as described above).
11032 11026
11033Infinities are especially useful as parts of @dfn{intervals}. 11027Infinities are especially useful as parts of @dfn{intervals}.
@@ -11070,7 +11064,7 @@ of its elements.
11070@tindex vec 11064@tindex vec
11071Algebraic functions for building vectors include @samp{vec(a, b, c)} 11065Algebraic functions for building vectors include @samp{vec(a, b, c)}
11072to build @samp{[a, b, c]}, @samp{cvec(a, n, m)} to build an 11066to build @samp{[a, b, c]}, @samp{cvec(a, n, m)} to build an
11073@texline @tmath{n\times m} 11067@texline @math{n\times m}
11074@infoline @var{n}x@var{m} 11068@infoline @var{n}x@var{m}
11075matrix of @samp{a}s, and @samp{index(n)} to build a vector of integers 11069matrix of @samp{a}s, and @samp{index(n)} to build a vector of integers
11076from 1 to @samp{n}. 11070from 1 to @samp{n}.
@@ -11201,7 +11195,7 @@ The @var{mins} value is an integer or integer-valued float between 0 and 59.
11201The @var{secs} value is a real number between 0 (inclusive) and 60 11195The @var{secs} value is a real number between 0 (inclusive) and 60
11202(exclusive). A positive HMS form is interpreted as @var{hours} + 11196(exclusive). A positive HMS form is interpreted as @var{hours} +
11203@var{mins}/60 + @var{secs}/3600. A negative HMS form is interpreted 11197@var{mins}/60 + @var{secs}/3600. A negative HMS form is interpreted
11204as @i{- @var{hours}} @i{-} @var{mins}/60 @i{-} @var{secs}/3600. 11198as @mathit{- @var{hours}} @mathit{-} @var{mins}/60 @mathit{-} @var{secs}/3600.
11205Display format for HMS forms is quite flexible. @xref{HMS Formats}. 11199Display format for HMS forms is quite flexible. @xref{HMS Formats}.
11206 11200
11207HMS forms can be added and subtracted. When they are added to numbers, 11201HMS forms can be added and subtracted. When they are added to numbers,
@@ -11295,12 +11289,12 @@ between, say, @samp{<12:00am Mon Jan 1, 1900>} and
11295 11289
11296Calc uses the Julian calendar for all dates before the year 1752, 11290Calc uses the Julian calendar for all dates before the year 1752,
11297including dates BC when the Julian calendar technically had not 11291including dates BC when the Julian calendar technically had not
11298yet been invented. Thus the claim that day number @i{-10000} is 11292yet been invented. Thus the claim that day number @mathit{-10000} is
11299called ``August 16, 28 BC'' should be taken with a grain of salt. 11293called ``August 16, 28 BC'' should be taken with a grain of salt.
11300 11294
11301Please note that there is no ``year 0''; the day before 11295Please note that there is no ``year 0''; the day before
11302@samp{<Sat Jan 1, +1>} is @samp{<Fri Dec 31, -1>}. These are 11296@samp{<Sat Jan 1, +1>} is @samp{<Fri Dec 31, -1>}. These are
11303days 0 and @i{-1} respectively in Calc's internal numbering scheme. 11297days 0 and @mathit{-1} respectively in Calc's internal numbering scheme.
11304 11298
11305@cindex Julian day counting 11299@cindex Julian day counting
11306Another day counting system in common use is, confusingly, also 11300Another day counting system in common use is, confusingly, also
@@ -11308,7 +11302,7 @@ called ``Julian.'' It was invented in 1583 by Joseph Justus
11308Scaliger, who named it in honor of his father Julius Caesar 11302Scaliger, who named it in honor of his father Julius Caesar
11309Scaliger. For obscure reasons he chose to start his day 11303Scaliger. For obscure reasons he chose to start his day
11310numbering on Jan 1, 4713 BC at noon, which in Calc's scheme 11304numbering on Jan 1, 4713 BC at noon, which in Calc's scheme
11311is @i{-1721423.5} (recall that Calc starts at midnight instead 11305is @mathit{-1721423.5} (recall that Calc starts at midnight instead
11312of noon). Thus to convert a Calc date code obtained by 11306of noon). Thus to convert a Calc date code obtained by
11313unpacking a date form into a Julian day number, simply add 11307unpacking a date form into a Julian day number, simply add
113141721423.5. The Julian code for @samp{6:00am Jan 9, 1991} 113081721423.5. The Julian code for @samp{6:00am Jan 9, 1991}
@@ -11341,7 +11335,7 @@ an integer multiple of) some value @var{M}. Arithmetic modulo @var{M}
11341often arises in number theory. Modulo forms are written 11335often arises in number theory. Modulo forms are written
11342`@var{a} @t{mod} @var{M}', 11336`@var{a} @t{mod} @var{M}',
11343where @var{a} and @var{M} are real numbers or HMS forms, and 11337where @var{a} and @var{M} are real numbers or HMS forms, and
11344@texline @tmath{0 \le a < M}. 11338@texline @math{0 \le a < M}.
11345@infoline @expr{0 <= a < @var{M}}. 11339@infoline @expr{0 <= a < @var{M}}.
11346In many applications @expr{a} and @expr{M} will be 11340In many applications @expr{a} and @expr{M} will be
11347integers but this is not required. 11341integers but this is not required.
@@ -11373,7 +11367,7 @@ division is left in symbolic form. Other operations, such as square
11373roots, are not yet supported for modulo forms. (Note that, although 11367roots, are not yet supported for modulo forms. (Note that, although
11374@w{`@t{(}@var{a} @t{mod} @var{M}@t{)^.5}'} will compute a ``modulo square root'' 11368@w{`@t{(}@var{a} @t{mod} @var{M}@t{)^.5}'} will compute a ``modulo square root''
11375in the sense of reducing 11369in the sense of reducing
11376@texline @tmath{\sqrt a} 11370@texline @math{\sqrt a}
11377@infoline @expr{sqrt(a)} 11371@infoline @expr{sqrt(a)}
11378modulo @expr{M}, this is not a useful definition from the 11372modulo @expr{M}, this is not a useful definition from the
11379number-theoretical point of view.) 11373number-theoretical point of view.)
@@ -11423,12 +11417,12 @@ The algebraic function @samp{makemod(a, m)} builds the modulo form
11423@cindex Standard deviations 11417@cindex Standard deviations
11424An @dfn{error form} is a number with an associated standard 11418An @dfn{error form} is a number with an associated standard
11425deviation, as in @samp{2.3 +/- 0.12}. The notation 11419deviation, as in @samp{2.3 +/- 0.12}. The notation
11426@texline `@var{x} @t{+/-} @tmath{\sigma}' 11420@texline `@var{x} @t{+/-} @math{\sigma}'
11427@infoline `@var{x} @t{+/-} sigma' 11421@infoline `@var{x} @t{+/-} sigma'
11428stands for an uncertain value which follows 11422stands for an uncertain value which follows
11429a normal or Gaussian distribution of mean @expr{x} and standard 11423a normal or Gaussian distribution of mean @expr{x} and standard
11430deviation or ``error'' 11424deviation or ``error''
11431@texline @tmath{\sigma}. 11425@texline @math{\sigma}.
11432@infoline @expr{sigma}. 11426@infoline @expr{sigma}.
11433Both the mean and the error can be either numbers or 11427Both the mean and the error can be either numbers or
11434formulas. Generally these are real numbers but the mean may also be 11428formulas. Generally these are real numbers but the mean may also be
@@ -11439,7 +11433,7 @@ regular number by the Calculator.
11439All arithmetic and transcendental functions accept error forms as input. 11433All arithmetic and transcendental functions accept error forms as input.
11440Operations on the mean-value part work just like operations on regular 11434Operations on the mean-value part work just like operations on regular
11441numbers. The error part for any function @expr{f(x)} (such as 11435numbers. The error part for any function @expr{f(x)} (such as
11442@texline @tmath{\sin x} 11436@texline @math{\sin x}
11443@infoline @expr{sin(x)}) 11437@infoline @expr{sin(x)})
11444is defined by the error of @expr{x} times the derivative of @expr{f} 11438is defined by the error of @expr{x} times the derivative of @expr{f}
11445evaluated at the mean value of @expr{x}. For a two-argument function 11439evaluated at the mean value of @expr{x}. For a two-argument function
@@ -11470,34 +11464,34 @@ Consult a good text on error analysis for a discussion of the proper use
11470of standard deviations. Actual errors often are neither Gaussian-distributed 11464of standard deviations. Actual errors often are neither Gaussian-distributed
11471nor uncorrelated, and the above formulas are valid only when errors 11465nor uncorrelated, and the above formulas are valid only when errors
11472are small. As an example, the error arising from 11466are small. As an example, the error arising from
11473@texline `@t{sin(}@var{x} @t{+/-} @tmath{\sigma}@t{)}' 11467@texline `@t{sin(}@var{x} @t{+/-} @math{\sigma}@t{)}'
11474@infoline `@t{sin(}@var{x} @t{+/-} @var{sigma}@t{)}' 11468@infoline `@t{sin(}@var{x} @t{+/-} @var{sigma}@t{)}'
11475is 11469is
11476@texline `@tmath{\sigma} @t{abs(cos(}@var{x}@t{))}'. 11470@texline `@math{\sigma} @t{abs(cos(}@var{x}@t{))}'.
11477@infoline `@var{sigma} @t{abs(cos(}@var{x}@t{))}'. 11471@infoline `@var{sigma} @t{abs(cos(}@var{x}@t{))}'.
11478When @expr{x} is close to zero, 11472When @expr{x} is close to zero,
11479@texline @tmath{\cos x} 11473@texline @math{\cos x}
11480@infoline @expr{cos(x)} 11474@infoline @expr{cos(x)}
11481is close to one so the error in the sine is close to 11475is close to one so the error in the sine is close to
11482@texline @tmath{\sigma}; 11476@texline @math{\sigma};
11483@infoline @expr{sigma}; 11477@infoline @expr{sigma};
11484this makes sense, since 11478this makes sense, since
11485@texline @tmath{\sin x} 11479@texline @math{\sin x}
11486@infoline @expr{sin(x)} 11480@infoline @expr{sin(x)}
11487is approximately @expr{x} near zero, so a given error in @expr{x} will 11481is approximately @expr{x} near zero, so a given error in @expr{x} will
11488produce about the same error in the sine. Likewise, near 90 degrees 11482produce about the same error in the sine. Likewise, near 90 degrees
11489@texline @tmath{\cos x} 11483@texline @math{\cos x}
11490@infoline @expr{cos(x)} 11484@infoline @expr{cos(x)}
11491is nearly zero and so the computed error is 11485is nearly zero and so the computed error is
11492small: The sine curve is nearly flat in that region, so an error in @expr{x} 11486small: The sine curve is nearly flat in that region, so an error in @expr{x}
11493has relatively little effect on the value of 11487has relatively little effect on the value of
11494@texline @tmath{\sin x}. 11488@texline @math{\sin x}.
11495@infoline @expr{sin(x)}. 11489@infoline @expr{sin(x)}.
11496However, consider @samp{sin(90 +/- 1000)}. The cosine of 90 is zero, so 11490However, consider @samp{sin(90 +/- 1000)}. The cosine of 90 is zero, so
11497Calc will report zero error! We get an obviously wrong result because 11491Calc will report zero error! We get an obviously wrong result because
11498we have violated the small-error approximation underlying the error 11492we have violated the small-error approximation underlying the error
11499analysis. If the error in @expr{x} had been small, the error in 11493analysis. If the error in @expr{x} had been small, the error in
11500@texline @tmath{\sin x} 11494@texline @math{\sin x}
11501@infoline @expr{sin(x)} 11495@infoline @expr{sin(x)}
11502would indeed have been negligible. 11496would indeed have been negligible.
11503 11497
@@ -11593,10 +11587,10 @@ rather than @samp{1 ..@: 0.1e2}. Add spaces or zeros if you want to
11593get the other interpretation. If you omit the lower or upper limit, 11587get the other interpretation. If you omit the lower or upper limit,
11594a default of @samp{-inf} or @samp{inf} (respectively) is furnished. 11588a default of @samp{-inf} or @samp{inf} (respectively) is furnished.
11595 11589
11596``Infinite mode'' also affects operations on intervals 11590Infinite mode also affects operations on intervals
11597(@pxref{Infinities}). Calc will always introduce an open infinity, 11591(@pxref{Infinities}). Calc will always introduce an open infinity,
11598as in @samp{1 / (0 .. 2] = [0.5 .. inf)}. But closed infinities, 11592as in @samp{1 / (0 .. 2] = [0.5 .. inf)}. But closed infinities,
11599@w{@samp{1 / [0 .. 2] = [0.5 .. inf]}}, arise only in infinite mode; 11593@w{@samp{1 / [0 .. 2] = [0.5 .. inf]}}, arise only in Infinite mode;
11600otherwise they are left unevaluated. Note that the ``direction'' of 11594otherwise they are left unevaluated. Note that the ``direction'' of
11601a zero is not an issue in this case since the zero is always assumed 11595a zero is not an issue in this case since the zero is always assumed
11602to be continuous with the rest of the interval. For intervals that 11596to be continuous with the rest of the interval. For intervals that
@@ -11606,11 +11600,11 @@ contain zero inside them Calc is forced to give the result,
11606While it may seem that intervals and error forms are similar, they are 11600While it may seem that intervals and error forms are similar, they are
11607based on entirely different concepts of inexact quantities. An error 11601based on entirely different concepts of inexact quantities. An error
11608form 11602form
11609@texline `@var{x} @t{+/-} @tmath{\sigma}' 11603@texline `@var{x} @t{+/-} @math{\sigma}'
11610@infoline `@var{x} @t{+/-} @var{sigma}' 11604@infoline `@var{x} @t{+/-} @var{sigma}'
11611means a variable is random, and its value could 11605means a variable is random, and its value could
11612be anything but is ``probably'' within one 11606be anything but is ``probably'' within one
11613@texline @tmath{\sigma} 11607@texline @math{\sigma}
11614@infoline @var{sigma} 11608@infoline @var{sigma}
11615of the mean value @expr{x}. An interval 11609of the mean value @expr{x}. An interval
11616`@t{[}@var{a} @t{..@:} @var{b}@t{]}' means a 11610`@t{[}@var{a} @t{..@:} @var{b}@t{]}' means a
@@ -11844,7 +11838,7 @@ the C-style ``if'' operator @samp{a?b:c} [@code{if}];
11844 11838
11845Note that, unlike in usual computer notation, multiplication binds more 11839Note that, unlike in usual computer notation, multiplication binds more
11846strongly than division: @samp{a*b/c*d} is equivalent to 11840strongly than division: @samp{a*b/c*d} is equivalent to
11847@texline @tmath{a b \over c d}. 11841@texline @math{a b \over c d}.
11848@infoline @expr{(a*b)/(c*d)}. 11842@infoline @expr{(a*b)/(c*d)}.
11849 11843
11850@cindex Multiplication, implicit 11844@cindex Multiplication, implicit
@@ -11911,7 +11905,7 @@ Commands that interpret (``parse'') text as algebraic formulas include
11911algebraic entry (@kbd{'}), editing commands like @kbd{`} which parse 11905algebraic entry (@kbd{'}), editing commands like @kbd{`} which parse
11912the contents of the editing buffer when you finish, the @kbd{M-# g} 11906the contents of the editing buffer when you finish, the @kbd{M-# g}
11913and @w{@kbd{M-# r}} commands, the @kbd{C-y} command, the X window system 11907and @w{@kbd{M-# r}} commands, the @kbd{C-y} command, the X window system
11914``paste'' mouse operation, and Embedded Mode. All of these operations 11908``paste'' mouse operation, and Embedded mode. All of these operations
11915use the same rules for parsing formulas; in particular, language modes 11909use the same rules for parsing formulas; in particular, language modes
11916(@pxref{Language Modes}) affect them all in the same way. 11910(@pxref{Language Modes}) affect them all in the same way.
11917 11911
@@ -12042,11 +12036,11 @@ intervening stack elements toward the top. @kbd{M-@key{TAB}} moves the
12042element at level @var{n} up to the top. (Compare with @key{LFD}, 12036element at level @var{n} up to the top. (Compare with @key{LFD},
12043which copies instead of moving the element in level @var{n}.) 12037which copies instead of moving the element in level @var{n}.)
12044 12038
12045With a negative argument @i{-@var{n}}, @key{TAB} rotates the stack 12039With a negative argument @mathit{-@var{n}}, @key{TAB} rotates the stack
12046to move the object in level @var{n} to the deepest place in the 12040to move the object in level @var{n} to the deepest place in the
12047stack, and the object in level @i{@var{n}+1} to the top. @kbd{M-@key{TAB}} 12041stack, and the object in level @mathit{@var{n}+1} to the top. @kbd{M-@key{TAB}}
12048rotates the deepest stack element to be in level @i{n}, also 12042rotates the deepest stack element to be in level @mathit{n}, also
12049putting the top stack element in level @i{@var{n}+1}. 12043putting the top stack element in level @mathit{@var{n}+1}.
12050 12044
12051@xref{Selecting Subformulas}, for a way to apply these commands to 12045@xref{Selecting Subformulas}, for a way to apply these commands to
12052any portion of a vector or formula on the stack. 12046any portion of a vector or formula on the stack.
@@ -12320,7 +12314,7 @@ Otherwise, the new mode information is appended to the end of the file.
12320@pindex calc-mode-record-mode 12314@pindex calc-mode-record-mode
12321The @kbd{m R} (@code{calc-mode-record-mode}) command tells Calc to 12315The @kbd{m R} (@code{calc-mode-record-mode}) command tells Calc to
12322record the new mode settings (as if by pressing @kbd{m m}) every 12316record the new mode settings (as if by pressing @kbd{m m}) every
12323time a mode setting changes. If Embedded Mode is enabled, other 12317time a mode setting changes. If Embedded mode is enabled, other
12324options are available; @pxref{Mode Settings in Embedded Mode}. 12318options are available; @pxref{Mode Settings in Embedded Mode}.
12325 12319
12326@kindex m F 12320@kindex m F
@@ -12341,8 +12335,8 @@ inside it, @kbd{m F} will not automatically load the new file. This
12341is because you are presumably switching to your @file{~/.emacs} file, 12335is because you are presumably switching to your @file{~/.emacs} file,
12342which may contain other things you don't want to reread. You can give 12336which may contain other things you don't want to reread. You can give
12343a numeric prefix argument of 1 to @kbd{m F} to force it to read the 12337a numeric prefix argument of 1 to @kbd{m F} to force it to read the
12344file no matter what its name. Conversely, an argument of @i{-1} tells 12338file no matter what its name. Conversely, an argument of @mathit{-1} tells
12345@kbd{m F} @emph{not} to read the new file. An argument of 2 or @i{-2} 12339@kbd{m F} @emph{not} to read the new file. An argument of 2 or @mathit{-2}
12346tells @kbd{m F} not to reset the modes to their defaults beforehand, 12340tells @kbd{m F} not to reset the modes to their defaults beforehand,
12347which is useful if you intend your new file to have a variant of the 12341which is useful if you intend your new file to have a variant of the
12348modes present in the file you were using before. 12342modes present in the file you were using before.
@@ -12447,7 +12441,7 @@ Hyperbolic Flag, which transforms @code{calc-sin} into @code{calc-sinh}.
12447If both of these flags are set at once, the effect will be 12441If both of these flags are set at once, the effect will be
12448@code{calc-arcsinh}. (The Hyperbolic flag is also used by some 12442@code{calc-arcsinh}. (The Hyperbolic flag is also used by some
12449non-trigonometric commands; for example @kbd{H L} computes a base-10, 12443non-trigonometric commands; for example @kbd{H L} computes a base-10,
12450instead of base-@i{e}, logarithm.) 12444instead of base-@mathit{e}, logarithm.)
12451 12445
12452Command names like @code{calc-arcsin} are provided for completeness, and 12446Command names like @code{calc-arcsin} are provided for completeness, and
12453may be executed with @kbd{x} or @kbd{M-x}. Their effect is simply to 12447may be executed with @kbd{x} or @kbd{M-x}. Their effect is simply to
@@ -12501,7 +12495,7 @@ Functions that compute angles produce a number in radians, a number in
12501degrees, or an HMS form depending on the current angular mode. If the 12495degrees, or an HMS form depending on the current angular mode. If the
12502result is a complex number and the current mode is HMS, the number is 12496result is a complex number and the current mode is HMS, the number is
12503instead expressed in degrees. (Complex-number calculations would 12497instead expressed in degrees. (Complex-number calculations would
12504normally be done in radians mode, though. Complex numbers are converted 12498normally be done in Radians mode, though. Complex numbers are converted
12505to degrees by calculating the complex result in radians and then 12499to degrees by calculating the complex result in radians and then
12506multiplying by 180 over @cpi{}.) 12500multiplying by 180 over @cpi{}.)
12507 12501
@@ -12514,7 +12508,7 @@ multiplying by 180 over @cpi{}.)
12514The @kbd{m r} (@code{calc-radians-mode}), @kbd{m d} (@code{calc-degrees-mode}), 12508The @kbd{m r} (@code{calc-radians-mode}), @kbd{m d} (@code{calc-degrees-mode}),
12515and @kbd{m h} (@code{calc-hms-mode}) commands control the angular mode. 12509and @kbd{m h} (@code{calc-hms-mode}) commands control the angular mode.
12516The current angular mode is displayed on the Emacs mode line. 12510The current angular mode is displayed on the Emacs mode line.
12517The default angular mode is degrees. 12511The default angular mode is Degrees.
12518 12512
12519@node Polar Mode, Fraction Mode, Angular Modes, Calculation Modes 12513@node Polar Mode, Fraction Mode, Angular Modes, Calculation Modes
12520@subsection Polar Mode 12514@subsection Polar Mode
@@ -12530,7 +12524,7 @@ number, or by entering @kbd{( 2 @key{SPC} 3 )}.
12530@kindex m p 12524@kindex m p
12531@pindex calc-polar-mode 12525@pindex calc-polar-mode
12532The @kbd{m p} (@code{calc-polar-mode}) command toggles complex-number 12526The @kbd{m p} (@code{calc-polar-mode}) command toggles complex-number
12533preference between rectangular and polar forms. In polar mode, all 12527preference between rectangular and polar forms. In Polar mode, all
12534of the above example situations would produce polar complex numbers. 12528of the above example situations would produce polar complex numbers.
12535 12529
12536@node Fraction Mode, Infinite Mode, Polar Mode, Calculation Modes 12530@node Fraction Mode, Infinite Mode, Polar Mode, Calculation Modes
@@ -12550,8 +12544,8 @@ even though @kbd{6 @key{RET} 4 /} produces @expr{1.5}.
12550To set the Calculator to produce fractional results for normal integer 12544To set the Calculator to produce fractional results for normal integer
12551divisions, use the @kbd{m f} (@code{calc-frac-mode}) command. 12545divisions, use the @kbd{m f} (@code{calc-frac-mode}) command.
12552For example, @expr{8/4} produces @expr{2} in either mode, 12546For example, @expr{8/4} produces @expr{2} in either mode,
12553but @expr{6/4} produces @expr{3:2} in Fraction Mode, @expr{1.5} in 12547but @expr{6/4} produces @expr{3:2} in Fraction mode, @expr{1.5} in
12554Float Mode. 12548Float mode.
12555 12549
12556At any time you can use @kbd{c f} (@code{calc-float}) to convert a 12550At any time you can use @kbd{c f} (@code{calc-float}) to convert a
12557fraction to a float, or @kbd{c F} (@code{calc-fraction}) to convert a 12551fraction to a float, or @kbd{c F} (@code{calc-fraction}) to convert a
@@ -12574,25 +12568,25 @@ on and off. When the mode is off, infinities do not arise except
12574in calculations that already had infinities as inputs. (One exception 12568in calculations that already had infinities as inputs. (One exception
12575is that infinite open intervals like @samp{[0 .. inf)} can be 12569is that infinite open intervals like @samp{[0 .. inf)} can be
12576generated; however, intervals closed at infinity (@samp{[0 .. inf]}) 12570generated; however, intervals closed at infinity (@samp{[0 .. inf]})
12577will not be generated when infinite mode is off.) 12571will not be generated when Infinite mode is off.)
12578 12572
12579With infinite mode turned on, @samp{1 / 0} will generate @code{uinf}, 12573With Infinite mode turned on, @samp{1 / 0} will generate @code{uinf},
12580an undirected infinity. @xref{Infinities}, for a discussion of the 12574an undirected infinity. @xref{Infinities}, for a discussion of the
12581difference between @code{inf} and @code{uinf}. Also, @expr{0 / 0} 12575difference between @code{inf} and @code{uinf}. Also, @expr{0 / 0}
12582evaluates to @code{nan}, the ``indeterminate'' symbol. Various other 12576evaluates to @code{nan}, the ``indeterminate'' symbol. Various other
12583functions can also return infinities in this mode; for example, 12577functions can also return infinities in this mode; for example,
12584@samp{ln(0) = -inf}, and @samp{gamma(-7) = uinf}. Once again, 12578@samp{ln(0) = -inf}, and @samp{gamma(-7) = uinf}. Once again,
12585note that @samp{exp(inf) = inf} regardless of infinite mode because 12579note that @samp{exp(inf) = inf} regardless of Infinite mode because
12586this calculation has infinity as an input. 12580this calculation has infinity as an input.
12587 12581
12588@cindex Positive infinite mode 12582@cindex Positive Infinite mode
12589The @kbd{m i} command with a numeric prefix argument of zero, 12583The @kbd{m i} command with a numeric prefix argument of zero,
12590i.e., @kbd{C-u 0 m i}, turns on a ``positive infinite mode'' in 12584i.e., @kbd{C-u 0 m i}, turns on a Positive Infinite mode in
12591which zero is treated as positive instead of being directionless. 12585which zero is treated as positive instead of being directionless.
12592Thus, @samp{1 / 0 = inf} and @samp{-1 / 0 = -inf} in this mode. 12586Thus, @samp{1 / 0 = inf} and @samp{-1 / 0 = -inf} in this mode.
12593Note that zero never actually has a sign in Calc; there are no 12587Note that zero never actually has a sign in Calc; there are no
12594separate representations for @i{+0} and @i{-0}. Positive 12588separate representations for @mathit{+0} and @mathit{-0}. Positive
12595infinite mode merely changes the interpretation given to the 12589Infinite mode merely changes the interpretation given to the
12596single symbol, @samp{0}. One consequence of this is that, while 12590single symbol, @samp{0}. One consequence of this is that, while
12597you might expect @samp{1 / -0 = -inf}, actually @samp{1 / -0} 12591you might expect @samp{1 / -0 = -inf}, actually @samp{1 / -0}
12598is equivalent to @samp{1 / 0}, which is equal to positive @code{inf}. 12592is equivalent to @samp{1 / 0}, which is equal to positive @code{inf}.
@@ -12611,7 +12605,7 @@ number or a symbolic expression if the argument is an expression:
12611 12605
12612@kindex m s 12606@kindex m s
12613@pindex calc-symbolic-mode 12607@pindex calc-symbolic-mode
12614In @dfn{symbolic mode}, controlled by the @kbd{m s} (@code{calc-symbolic-mode}) 12608In @dfn{Symbolic mode}, controlled by the @kbd{m s} (@code{calc-symbolic-mode})
12615command, functions which would produce inexact, irrational results are 12609command, functions which would produce inexact, irrational results are
12616left in symbolic form. Thus @kbd{16 Q} pushes 4, but @kbd{2 Q} pushes 12610left in symbolic form. Thus @kbd{16 Q} pushes 4, but @kbd{2 Q} pushes
12617@samp{sqrt(2)}. 12611@samp{sqrt(2)}.
@@ -12638,12 +12632,12 @@ variables.)
12638@cindex Scalar mode 12632@cindex Scalar mode
12639Calc sometimes makes assumptions during algebraic manipulation that 12633Calc sometimes makes assumptions during algebraic manipulation that
12640are awkward or incorrect when vectors and matrices are involved. 12634are awkward or incorrect when vectors and matrices are involved.
12641Calc has two modes, @dfn{matrix mode} and @dfn{scalar mode}, which 12635Calc has two modes, @dfn{Matrix mode} and @dfn{Scalar mode}, which
12642modify its behavior around vectors in useful ways. 12636modify its behavior around vectors in useful ways.
12643 12637
12644@kindex m v 12638@kindex m v
12645@pindex calc-matrix-mode 12639@pindex calc-matrix-mode
12646Press @kbd{m v} (@code{calc-matrix-mode}) once to enter matrix mode. 12640Press @kbd{m v} (@code{calc-matrix-mode}) once to enter Matrix mode.
12647In this mode, all objects are assumed to be matrices unless provably 12641In this mode, all objects are assumed to be matrices unless provably
12648otherwise. One major effect is that Calc will no longer consider 12642otherwise. One major effect is that Calc will no longer consider
12649multiplication to be commutative. (Recall that in matrix arithmetic, 12643multiplication to be commutative. (Recall that in matrix arithmetic,
@@ -12662,18 +12656,18 @@ a true identity matrix of the appropriate size. On the other hand,
12662if it is combined with a scalar (as in @samp{idn(1) + 2}), Calc 12656if it is combined with a scalar (as in @samp{idn(1) + 2}), Calc
12663will assume it really was a scalar after all and produce, e.g., 3. 12657will assume it really was a scalar after all and produce, e.g., 3.
12664 12658
12665Press @kbd{m v} a second time to get scalar mode. Here, objects are 12659Press @kbd{m v} a second time to get Scalar mode. Here, objects are
12666assumed @emph{not} to be vectors or matrices unless provably so. 12660assumed @emph{not} to be vectors or matrices unless provably so.
12667For example, normally adding a variable to a vector, as in 12661For example, normally adding a variable to a vector, as in
12668@samp{[x, y, z] + a}, will leave the sum in symbolic form because 12662@samp{[x, y, z] + a}, will leave the sum in symbolic form because
12669as far as Calc knows, @samp{a} could represent either a number or 12663as far as Calc knows, @samp{a} could represent either a number or
12670another 3-vector. In scalar mode, @samp{a} is assumed to be a 12664another 3-vector. In Scalar mode, @samp{a} is assumed to be a
12671non-vector, and the addition is evaluated to @samp{[x+a, y+a, z+a]}. 12665non-vector, and the addition is evaluated to @samp{[x+a, y+a, z+a]}.
12672 12666
12673Press @kbd{m v} a third time to return to the normal mode of operation. 12667Press @kbd{m v} a third time to return to the normal mode of operation.
12674 12668
12675If you press @kbd{m v} with a numeric prefix argument @var{n}, you 12669If you press @kbd{m v} with a numeric prefix argument @var{n}, you
12676get a special ``dimensioned matrix mode'' in which matrices of 12670get a special ``dimensioned'' Matrix mode in which matrices of
12677unknown size are assumed to be @var{n}x@var{n} square matrices. 12671unknown size are assumed to be @var{n}x@var{n} square matrices.
12678Then, the function call @samp{idn(1)} will expand into an actual 12672Then, the function call @samp{idn(1)} will expand into an actual
12679matrix rather than representing a ``generic'' matrix. 12673matrix rather than representing a ``generic'' matrix.
@@ -12694,11 +12688,11 @@ for @samp{[x, y, z] + [1, 2, 3]}, but that's because you have broken
12694your earlier promise to Calc that @samp{a} would be scalar. 12688your earlier promise to Calc that @samp{a} would be scalar.
12695 12689
12696Another way to mix scalars and matrices is to use selections 12690Another way to mix scalars and matrices is to use selections
12697(@pxref{Selecting Subformulas}). Use matrix mode when operating on 12691(@pxref{Selecting Subformulas}). Use Matrix mode when operating on
12698your formula normally; then, to apply scalar mode to a certain part 12692your formula normally; then, to apply Scalar mode to a certain part
12699of the formula without affecting the rest just select that part, 12693of the formula without affecting the rest just select that part,
12700change into scalar mode and press @kbd{=} to resimplify the part 12694change into Scalar mode and press @kbd{=} to resimplify the part
12701under this mode, then change back to matrix mode before deselecting. 12695under this mode, then change back to Matrix mode before deselecting.
12702 12696
12703@node Automatic Recomputation, Working Message, Matrix Mode, Calculation Modes 12697@node Automatic Recomputation, Working Message, Matrix Mode, Calculation Modes
12704@subsection Automatic Recomputation 12698@subsection Automatic Recomputation
@@ -12714,7 +12708,7 @@ are changed. @xref{Evaluates-To Operator}.
12714The @kbd{m C} (@code{calc-auto-recompute}) command turns this 12708The @kbd{m C} (@code{calc-auto-recompute}) command turns this
12715automatic recomputation on and off. If you turn it off, Calc will 12709automatic recomputation on and off. If you turn it off, Calc will
12716not update @samp{=>} operators on the stack (nor those in the 12710not update @samp{=>} operators on the stack (nor those in the
12717attached Embedded Mode buffer, if there is one). They will not 12711attached Embedded mode buffer, if there is one). They will not
12718be updated unless you explicitly do so by pressing @kbd{=} or until 12712be updated unless you explicitly do so by pressing @kbd{=} or until
12719you press @kbd{m C} to turn recomputation back on. (While automatic 12713you press @kbd{m C} to turn recomputation back on. (While automatic
12720recomputation is off, you can think of @kbd{m C m C} as a command 12714recomputation is off, you can think of @kbd{m C m C} as a command
@@ -12835,7 +12829,7 @@ A common technique is to set the simplification mode down to the lowest
12835amount of simplification you will allow to be applied automatically, then 12829amount of simplification you will allow to be applied automatically, then
12836use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to 12830use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to
12837perform higher types of simplifications on demand. @xref{Algebraic 12831perform higher types of simplifications on demand. @xref{Algebraic
12838Definitions}, for another sample use of no-simplification mode. 12832Definitions}, for another sample use of No-Simplification mode.
12839 12833
12840@node Declarations, Display Modes, Simplification Modes, Mode Settings 12834@node Declarations, Display Modes, Simplification Modes, Mode Settings
12841@section Declarations 12835@section Declarations
@@ -12982,7 +12976,7 @@ Numbers. (Real or complex.)
12982Calc uses this information to determine when certain simplifications 12976Calc uses this information to determine when certain simplifications
12983of formulas are safe. For example, @samp{(x^y)^z} cannot be 12977of formulas are safe. For example, @samp{(x^y)^z} cannot be
12984simplified to @samp{x^(y z)} in general; for example, 12978simplified to @samp{x^(y z)} in general; for example,
12985@samp{((-3)^2)^1:2} is 3, but @samp{(-3)^(2*1:2) = (-3)^1} is @i{-3}. 12979@samp{((-3)^2)^1:2} is 3, but @samp{(-3)^(2*1:2) = (-3)^1} is @mathit{-3}.
12986However, this simplification @emph{is} safe if @code{z} is known 12980However, this simplification @emph{is} safe if @code{z} is known
12987to be an integer, or if @code{x} is known to be a nonnegative 12981to be an integer, or if @code{x} is known to be a nonnegative
12988real number. If you have given declarations that allow Calc to 12982real number. If you have given declarations that allow Calc to
@@ -13082,8 +13076,8 @@ and @code{y} are known to be vectors or matrices. (Calc currently
13082never distinguishes between @code{vector} and @code{matrix} 13076never distinguishes between @code{vector} and @code{matrix}
13083declarations.) 13077declarations.)
13084 13078
13085@xref{Matrix Mode}, for a discussion of ``matrix mode'' and 13079@xref{Matrix Mode}, for a discussion of Matrix mode and
13086``scalar mode,'' which are similar to declaring @samp{[All, matrix]} 13080Scalar mode, which are similar to declaring @samp{[All, matrix]}
13087or @samp{[All, scalar]} but much more convenient. 13081or @samp{[All, scalar]} but much more convenient.
13088 13082
13089One more type symbol that is recognized is used with the @kbd{H a d} 13083One more type symbol that is recognized is used with the @kbd{H a d}
@@ -13095,7 +13089,7 @@ The value is a constant with respect to other variables.
13095@end table 13089@end table
13096 13090
13097Calc does not check the declarations for a variable when you store 13091Calc does not check the declarations for a variable when you store
13098a value in it. However, storing @i{-3.5} in a variable that has 13092a value in it. However, storing @mathit{-3.5} in a variable that has
13099been declared @code{pos}, @code{int}, or @code{matrix} may have 13093been declared @code{pos}, @code{int}, or @code{matrix} may have
13100unexpected effects; Calc may evaluate @samp{sqrt(x^2)} to @expr{3.5} 13094unexpected effects; Calc may evaluate @samp{sqrt(x^2)} to @expr{3.5}
13101if it substitutes the value first, or to @expr{-3.5} if @code{x} 13095if it substitutes the value first, or to @expr{-3.5} if @code{x}
@@ -13235,8 +13229,8 @@ remains unevaluated.
13235@tindex dscalar 13229@tindex dscalar
13236The @code{dscalar} function returns 1 if its argument is provably 13230The @code{dscalar} function returns 1 if its argument is provably
13237scalar, or 0 if its argument is provably non-scalar. It is left 13231scalar, or 0 if its argument is provably non-scalar. It is left
13238unevaluated if this cannot be determined. (If matrix mode or scalar 13232unevaluated if this cannot be determined. (If Matrix mode or Scalar
13239mode are in effect, this function returns 1 or 0, respectively, 13233mode is in effect, this function returns 1 or 0, respectively,
13240if it has no other information.) When Calc interprets a condition 13234if it has no other information.) When Calc interprets a condition
13241(say, in a rewrite rule) it considers an unevaluated formula to be 13235(say, in a rewrite rule) it considers an unevaluated formula to be
13242``false.'' Thus, @samp{dscalar(a)} is ``true'' only if @code{a} is 13236``false.'' Thus, @samp{dscalar(a)} is ``true'' only if @code{a} is
@@ -13330,7 +13324,7 @@ command causes integers to be padded out with leading zeros according to the
13330current binary word size. (@xref{Binary Functions}, for a discussion of 13324current binary word size. (@xref{Binary Functions}, for a discussion of
13331word size.) If the absolute value of the word size is @expr{w}, all integers 13325word size.) If the absolute value of the word size is @expr{w}, all integers
13332are displayed with at least enough digits to represent 13326are displayed with at least enough digits to represent
13333@texline @tmath{2^w-1} 13327@texline @math{2^w-1}
13334@infoline @expr{(2^w)-1} 13328@infoline @expr{(2^w)-1}
13335in the current radix. (Larger integers will still be displayed in their 13329in the current radix. (Larger integers will still be displayed in their
13336entirety.) 13330entirety.)
@@ -13345,7 +13339,7 @@ entirety.)
13345@cindex Digit grouping 13339@cindex Digit grouping
13346Long numbers can be hard to read if they have too many digits. For 13340Long numbers can be hard to read if they have too many digits. For
13347example, the factorial of 30 is 33 digits long! Press @kbd{d g} 13341example, the factorial of 30 is 33 digits long! Press @kbd{d g}
13348(@code{calc-group-digits}) to enable @dfn{grouping} mode, in which digits 13342(@code{calc-group-digits}) to enable @dfn{Grouping} mode, in which digits
13349are displayed in clumps of 3 or 4 (depending on the current radix) 13343are displayed in clumps of 3 or 4 (depending on the current radix)
13350separated by commas. 13344separated by commas.
13351 13345
@@ -13891,7 +13885,7 @@ line at a time (or several lines with a prefix argument).
13891Values on the stack are normally left-justified in the window. You can 13885Values on the stack are normally left-justified in the window. You can
13892control this arrangement by typing @kbd{d <} (@code{calc-left-justify}), 13886control this arrangement by typing @kbd{d <} (@code{calc-left-justify}),
13893@kbd{d >} (@code{calc-right-justify}), or @kbd{d =} 13887@kbd{d >} (@code{calc-right-justify}), or @kbd{d =}
13894(@code{calc-center-justify}). For example, in right-justification mode, 13888(@code{calc-center-justify}). For example, in Right-Justification mode,
13895stack entries are displayed flush-right against the right edge of the 13889stack entries are displayed flush-right against the right edge of the
13896window. 13890window.
13897 13891
@@ -13912,20 +13906,20 @@ breaking lines are given below. Notice that the interaction between
13912origin and line width is slightly different in each justification 13906origin and line width is slightly different in each justification
13913mode. 13907mode.
13914 13908
13915In left-justified mode, the line is indented by a number of spaces 13909In Left-Justified mode, the line is indented by a number of spaces
13916given by the origin (default zero). If the result is longer than the 13910given by the origin (default zero). If the result is longer than the
13917maximum line width, if given, or too wide to fit in the Calc window 13911maximum line width, if given, or too wide to fit in the Calc window
13918otherwise, then it is broken into lines which will fit; each broken 13912otherwise, then it is broken into lines which will fit; each broken
13919line is indented to the origin. 13913line is indented to the origin.
13920 13914
13921In right-justified mode, lines are shifted right so that the rightmost 13915In Right-Justified mode, lines are shifted right so that the rightmost
13922character is just before the origin, or just before the current 13916character is just before the origin, or just before the current
13923window width if no origin was specified. If the line is too long 13917window width if no origin was specified. If the line is too long
13924for this, then it is broken; the current line width is used, if 13918for this, then it is broken; the current line width is used, if
13925specified, or else the origin is used as a width if that is 13919specified, or else the origin is used as a width if that is
13926specified, or else the line is broken to fit in the window. 13920specified, or else the line is broken to fit in the window.
13927 13921
13928In centering mode, the origin is the column number of the center of 13922In Centering mode, the origin is the column number of the center of
13929each stack entry. If a line width is specified, lines will not be 13923each stack entry. If a line width is specified, lines will not be
13930allowed to go past that width; Calc will either indent less or 13924allowed to go past that width; Calc will either indent less or
13931break the lines if necessary. If no origin is specified, half the 13925break the lines if necessary. If no origin is specified, half the
@@ -13960,13 +13954,13 @@ Give a blank string (with @kbd{d @{ @key{RET}}) to turn the label off.
13960The @kbd{d @}} (@code{calc-right-label}) command similarly adds a 13954The @kbd{d @}} (@code{calc-right-label}) command similarly adds a
13961label on the righthand side. It does not affect positioning of 13955label on the righthand side. It does not affect positioning of
13962the stack entries unless they are right-justified. Also, if both 13956the stack entries unless they are right-justified. Also, if both
13963a line width and an origin are given in right-justified mode, the 13957a line width and an origin are given in Right-Justified mode, the
13964stack entry is justified to the origin and the righthand label is 13958stack entry is justified to the origin and the righthand label is
13965justified to the line width. 13959justified to the line width.
13966 13960
13967One application of labels would be to add equation numbers to 13961One application of labels would be to add equation numbers to
13968formulas you are manipulating in Calc and then copying into a 13962formulas you are manipulating in Calc and then copying into a
13969document (possibly using Embedded Mode). The equations would 13963document (possibly using Embedded mode). The equations would
13970typically be centered, and the equation numbers would be on the 13964typically be centered, and the equation numbers would be on the
13971left or right as you prefer. 13965left or right as you prefer.
13972 13966
@@ -14068,7 +14062,7 @@ such as powers, quotients, and square roots:
14068@noindent 14062@noindent
14069in place of @samp{sqrt((a+1)/b + c^2)}. 14063in place of @samp{sqrt((a+1)/b + c^2)}.
14070 14064
14071Subscripts like @samp{a_i} are displayed as actual subscripts in ``big'' 14065Subscripts like @samp{a_i} are displayed as actual subscripts in Big
14072mode. Double subscripts, @samp{a_i_j} (@samp{subscr(subscr(a, i), j)}) 14066mode. Double subscripts, @samp{a_i_j} (@samp{subscr(subscr(a, i), j)})
14073are displayed as @samp{a} with subscripts separated by commas: 14067are displayed as @samp{a} with subscripts separated by commas:
14074@samp{i, j}. They must still be entered in the usual underscore 14068@samp{i, j}. They must still be entered in the usual underscore
@@ -14141,12 +14135,12 @@ In C mode, vectors and matrices use curly braces instead of brackets.
14141Octal and hexadecimal values are written with leading @samp{0} or @samp{0x} 14135Octal and hexadecimal values are written with leading @samp{0} or @samp{0x}
14142rather than using the @samp{#} symbol. Array subscripting is 14136rather than using the @samp{#} symbol. Array subscripting is
14143translated into @code{subscr} calls, so that @samp{a[i]} in C 14137translated into @code{subscr} calls, so that @samp{a[i]} in C
14144mode is the same as @samp{a_i} in normal mode. Assignments 14138mode is the same as @samp{a_i} in Normal mode. Assignments
14145turn into the @code{assign} function, which Calc normally displays 14139turn into the @code{assign} function, which Calc normally displays
14146using the @samp{:=} symbol. 14140using the @samp{:=} symbol.
14147 14141
14148The variables @code{var-pi} and @code{var-e} would be displayed @samp{pi} 14142The variables @code{var-pi} and @code{var-e} would be displayed @samp{pi}
14149and @samp{e} in normal mode, but in C mode they are displayed as 14143and @samp{e} in Normal mode, but in C mode they are displayed as
14150@samp{M_PI} and @samp{M_E}, corresponding to the names of constants 14144@samp{M_PI} and @samp{M_E}, corresponding to the names of constants
14151typically provided in the @file{<math.h>} header. Functions whose 14145typically provided in the @file{<math.h>} header. Functions whose
14152names are different in C are translated automatically for entry and 14146names are different in C are translated automatically for entry and
@@ -14188,7 +14182,7 @@ function!).
14188 14182
14189Underscores are allowed in variable and function names in all of these 14183Underscores are allowed in variable and function names in all of these
14190language modes. The underscore here is equivalent to the @samp{#} in 14184language modes. The underscore here is equivalent to the @samp{#} in
14191normal mode, or to hyphens in the underlying Emacs Lisp variable names. 14185Normal mode, or to hyphens in the underlying Emacs Lisp variable names.
14192 14186
14193FORTRAN and Pascal modes normally do not adjust the case of letters in 14187FORTRAN and Pascal modes normally do not adjust the case of letters in
14194formulas. Most built-in Calc names use lower-case letters. If you use a 14188formulas. Most built-in Calc names use lower-case letters. If you use a
@@ -14231,10 +14225,10 @@ special names (like @code{\sin}) will use curly braces instead of
14231parentheses for very simple arguments. During input, curly braces and 14225parentheses for very simple arguments. During input, curly braces and
14232parentheses work equally well for grouping, but when the document is 14226parentheses work equally well for grouping, but when the document is
14233formatted the curly braces will be invisible. Thus the printed result is 14227formatted the curly braces will be invisible. Thus the printed result is
14234@texline @tmath{\sin{2 x}} 14228@texline @math{\sin{2 x}}
14235@infoline @expr{sin 2x} 14229@infoline @expr{sin 2x}
14236but 14230but
14237@texline @tmath{\sin(2 + x)}. 14231@texline @math{\sin(2 + x)}.
14238@infoline @expr{sin(2 + x)}. 14232@infoline @expr{sin(2 + x)}.
14239 14233
14240Function and variable names not treated specially by @TeX{} are simply 14234Function and variable names not treated specially by @TeX{} are simply
@@ -14830,7 +14824,7 @@ object.
14830@tindex choriz 14824@tindex choriz
14831The @code{choriz} function takes a vector of objects and composes 14825The @code{choriz} function takes a vector of objects and composes
14832them horizontally. For example, @samp{choriz([17, a b/c, d])} formats 14826them horizontally. For example, @samp{choriz([17, a b/c, d])} formats
14833as @w{@samp{17a b / cd}} in normal language mode, or as 14827as @w{@samp{17a b / cd}} in Normal language mode, or as
14834 14828
14835@example 14829@example
14836@group 14830@group
@@ -15093,7 +15087,7 @@ then return a certain measurement of the composition as an integer.
15093@tindex cwidth 15087@tindex cwidth
15094The @code{cwidth} function measures the width, in characters, of a 15088The @code{cwidth} function measures the width, in characters, of a
15095composition. For example, @samp{cwidth(a + b)} is 5, and 15089composition. For example, @samp{cwidth(a + b)} is 5, and
15096@samp{cwidth(a / b)} is 5 in normal mode, 1 in Big mode, and 11 in 15090@samp{cwidth(a / b)} is 5 in Normal mode, 1 in Big mode, and 11 in
15097@TeX{} mode (for @samp{@{a \over b@}}). The argument may involve 15091@TeX{} mode (for @samp{@{a \over b@}}). The argument may involve
15098the composition functions described in this section. 15092the composition functions described in this section.
15099 15093
@@ -15269,7 +15263,7 @@ unrelated to the syntax tables described in the Emacs manual.)
15269@pindex calc-edit-user-syntax 15263@pindex calc-edit-user-syntax
15270The @kbd{Z S} (@code{calc-edit-user-syntax}) command edits the 15264The @kbd{Z S} (@code{calc-edit-user-syntax}) command edits the
15271syntax table for the current language mode. If you want your 15265syntax table for the current language mode. If you want your
15272syntax to work in any language, define it in the normal language 15266syntax to work in any language, define it in the Normal language
15273mode. Type @kbd{M-# M-#} to finish editing the syntax table, or 15267mode. Type @kbd{M-# M-#} to finish editing the syntax table, or
15274@kbd{M-# x} to cancel the edit. The @kbd{m m} command saves all 15268@kbd{M-# x} to cancel the edit. The @kbd{m m} command saves all
15275the syntax tables along with the other mode settings; 15269the syntax tables along with the other mode settings;
@@ -15300,7 +15294,7 @@ zero or more expressions separated by commas, and @samp{)}.''
15300A @dfn{syntax table} is a list of user-defined @dfn{syntax rules}, 15294A @dfn{syntax table} is a list of user-defined @dfn{syntax rules},
15301which allow you to specify new patterns to define your own 15295which allow you to specify new patterns to define your own
15302favorite input notations. Calc's parser always checks the syntax 15296favorite input notations. Calc's parser always checks the syntax
15303table for the current language mode, then the table for the normal 15297table for the current language mode, then the table for the Normal
15304language mode, before it uses its built-in rules to parse an 15298language mode, before it uses its built-in rules to parse an
15305algebraic formula you have entered. Each syntax rule should go on 15299algebraic formula you have entered. Each syntax rule should go on
15306its own line; it consists of a @dfn{pattern}, a @samp{:=} symbol, 15300its own line; it consists of a @dfn{pattern}, a @samp{:=} symbol,
@@ -15655,7 +15649,7 @@ In this approach, we allow @samp{#2} to equal the whole expression
15655@samp{i=1..10}. Then, we use @code{matches} to break it apart into 15649@samp{i=1..10}. Then, we use @code{matches} to break it apart into
15656its components. If the expression turns out not to match the pattern, 15650its components. If the expression turns out not to match the pattern,
15657the syntax rule will fail. Note that @kbd{Z S} always uses Calc's 15651the syntax rule will fail. Note that @kbd{Z S} always uses Calc's
15658normal language mode for editing expressions in syntax rules, so we 15652Normal language mode for editing expressions in syntax rules, so we
15659must use regular Calc notation for the interval @samp{[b..c]} that 15653must use regular Calc notation for the interval @samp{[b..c]} that
15660will correspond to the Maple mode interval @samp{1..10}. 15654will correspond to the Maple mode interval @samp{1..10}.
15661 15655
@@ -15728,19 +15722,19 @@ Polar mode. Value is 0 (rectangular) or 1 (polar); default is 0.
15728Command is @kbd{m p}. 15722Command is @kbd{m p}.
15729 15723
15730@item 15724@item
15731Matrix/scalar mode. Default value is @i{-1}. Value is 0 for scalar 15725Matrix/Scalar mode. Default value is @mathit{-1}. Value is 0 for Scalar
15732mode, @i{-2} for matrix mode, or @var{N} for 15726mode, @mathit{-2} for Matrix mode, or @var{N} for
15733@texline @tmath{N\times N} 15727@texline @math{N\times N}
15734@infoline @var{N}x@var{N} 15728@infoline @var{N}x@var{N}
15735matrix mode. Command is @kbd{m v}. 15729Matrix mode. Command is @kbd{m v}.
15736 15730
15737@item 15731@item
15738Simplification mode. Default is 1. Value is @i{-1} for off (@kbd{m O}), 15732Simplification mode. Default is 1. Value is @mathit{-1} for off (@kbd{m O}),
157390 for @kbd{m N}, 2 for @kbd{m B}, 3 for @kbd{m A}, 4 for @kbd{m E}, 157330 for @kbd{m N}, 2 for @kbd{m B}, 3 for @kbd{m A}, 4 for @kbd{m E},
15740or 5 for @w{@kbd{m U}}. The @kbd{m D} command accepts these prefixes. 15734or 5 for @w{@kbd{m U}}. The @kbd{m D} command accepts these prefixes.
15741 15735
15742@item 15736@item
15743Infinite mode. Default is @i{-1} (off). Value is 1 if the mode is on, 15737Infinite mode. Default is @mathit{-1} (off). Value is 1 if the mode is on,
15744or 0 if the mode is on with positive zeros. Command is @kbd{m i}. 15738or 0 if the mode is on with positive zeros. Command is @kbd{m i}.
15745@end enumerate 15739@end enumerate
15746 15740
@@ -15767,7 +15761,7 @@ programming commands. @xref{Conditionals in Macros}.)
15767@cindex Mode line indicators 15761@cindex Mode line indicators
15768This section is a summary of all symbols that can appear on the 15762This section is a summary of all symbols that can appear on the
15769Calc mode line, the highlighted bar that appears under the Calc 15763Calc mode line, the highlighted bar that appears under the Calc
15770stack window (or under an editing window in Embedded Mode). 15764stack window (or under an editing window in Embedded mode).
15771 15765
15772The basic mode line format is: 15766The basic mode line format is:
15773 15767
@@ -15779,7 +15773,7 @@ The @samp{%%} is the Emacs symbol for ``read-only''; it shows that
15779regular Emacs commands are not allowed to edit the stack buffer 15773regular Emacs commands are not allowed to edit the stack buffer
15780as if it were text. 15774as if it were text.
15781 15775
15782The word @samp{Calc:} changes to @samp{CalcEmbed:} if Embedded Mode 15776The word @samp{Calc:} changes to @samp{CalcEmbed:} if Embedded mode
15783is enabled. The words after this describe the various Calc modes 15777is enabled. The words after this describe the various Calc modes
15784that are in effect. 15778that are in effect.
15785 15779
@@ -15807,7 +15801,7 @@ Symbolic mode (@kbd{m s}; @pxref{Symbolic Mode}).
15807Matrix mode (@kbd{m v}; @pxref{Matrix Mode}). 15801Matrix mode (@kbd{m v}; @pxref{Matrix Mode}).
15808 15802
15809@item Matrix@var{n} 15803@item Matrix@var{n}
15810Dimensioned matrix mode (@kbd{C-u @var{n} m v}). 15804Dimensioned Matrix mode (@kbd{C-u @var{n} m v}).
15811 15805
15812@item Scalar 15806@item Scalar
15813Scalar mode (@kbd{m v}; @pxref{Matrix Mode}). 15807Scalar mode (@kbd{m v}; @pxref{Matrix Mode}).
@@ -15822,7 +15816,7 @@ Fraction mode (@kbd{m f}; @pxref{Fraction Mode}).
15822Infinite mode (@kbd{m i}; @pxref{Infinite Mode}). 15816Infinite mode (@kbd{m i}; @pxref{Infinite Mode}).
15823 15817
15824@item +Inf 15818@item +Inf
15825Positive infinite mode (@kbd{C-u 0 m i}). 15819Positive Infinite mode (@kbd{C-u 0 m i}).
15826 15820
15827@item NoSimp 15821@item NoSimp
15828Default simplifications off (@kbd{m O}; @pxref{Simplification Modes}). 15822Default simplifications off (@kbd{m O}; @pxref{Simplification Modes}).
@@ -16030,14 +16024,14 @@ to every element of a vector.
16030 16024
16031If either argument of @kbd{+} is a complex number, the result will in general 16025If either argument of @kbd{+} is a complex number, the result will in general
16032be complex. If one argument is in rectangular form and the other polar, 16026be complex. If one argument is in rectangular form and the other polar,
16033the current Polar Mode determines the form of the result. If Symbolic 16027the current Polar mode determines the form of the result. If Symbolic
16034Mode is enabled, the sum may be left as a formula if the necessary 16028mode is enabled, the sum may be left as a formula if the necessary
16035conversions for polar addition are non-trivial. 16029conversions for polar addition are non-trivial.
16036 16030
16037If both arguments of @kbd{+} are HMS forms, the forms are added according to 16031If both arguments of @kbd{+} are HMS forms, the forms are added according to
16038the usual conventions of hours-minutes-seconds notation. If one argument 16032the usual conventions of hours-minutes-seconds notation. If one argument
16039is an HMS form and the other is a number, that number is converted from 16033is an HMS form and the other is a number, that number is converted from
16040degrees or radians (depending on the current Angular Mode) to HMS format 16034degrees or radians (depending on the current Angular mode) to HMS format
16041and then the two HMS forms are added. 16035and then the two HMS forms are added.
16042 16036
16043If one argument of @kbd{+} is a date form, the other can be either a 16037If one argument of @kbd{+} is a date form, the other can be either a
@@ -16081,7 +16075,7 @@ infinite in different directions the result is @code{nan}.
16081@tindex - 16075@tindex -
16082The @kbd{-} (@code{calc-minus}) command subtracts two values. The top 16076The @kbd{-} (@code{calc-minus}) command subtracts two values. The top
16083number on the stack is subtracted from the one behind it, so that the 16077number on the stack is subtracted from the one behind it, so that the
16084computation @kbd{5 @key{RET} 2 -} produces 3, not @i{-3}. All options 16078computation @kbd{5 @key{RET} 2 -} produces 3, not @mathit{-3}. All options
16085available for @kbd{+} are available for @kbd{-} as well. 16079available for @kbd{+} are available for @kbd{-} as well.
16086 16080
16087@kindex * 16081@kindex *
@@ -16189,7 +16183,7 @@ must be positive real number.
16189@tindex fdiv 16183@tindex fdiv
16190The @kbd{:} (@code{calc-fdiv}) command [@code{fdiv} function in a formula] 16184The @kbd{:} (@code{calc-fdiv}) command [@code{fdiv} function in a formula]
16191divides the two integers on the top of the stack to produce a fractional 16185divides the two integers on the top of the stack to produce a fractional
16192result. This is a convenient shorthand for enabling Fraction Mode (with 16186result. This is a convenient shorthand for enabling Fraction mode (with
16193@kbd{m f}) temporarily and using @samp{/}. Note that during numeric entry 16187@kbd{m f}) temporarily and using @samp{/}. Note that during numeric entry
16194the @kbd{:} key is interpreted as a fraction separator, so to divide 8 by 6 16188the @kbd{:} key is interpreted as a fraction separator, so to divide 8 by 6
16195you would have to type @kbd{8 @key{RET} 6 @key{RET} :}. (Of course, in 16189you would have to type @kbd{8 @key{RET} 6 @key{RET} :}. (Of course, in
@@ -16225,7 +16219,7 @@ absolute value squared of a number, vector or matrix, or error form.
16225@pindex calc-sign 16219@pindex calc-sign
16226@tindex sign 16220@tindex sign
16227The @kbd{f s} (@code{calc-sign}) [@code{sign}] command returns 1 if its 16221The @kbd{f s} (@code{calc-sign}) [@code{sign}] command returns 1 if its
16228argument is positive, @i{-1} if its argument is negative, or 0 if its 16222argument is positive, @mathit{-1} if its argument is negative, or 0 if its
16229argument is zero. In algebraic form, you can also write @samp{sign(a,x)} 16223argument is zero. In algebraic form, you can also write @samp{sign(a,x)}
16230which evaluates to @samp{x * sign(a)}, i.e., either @samp{x}, @samp{-x}, or 16224which evaluates to @samp{x * sign(a)}, i.e., either @samp{x}, @samp{-x}, or
16231zero depending on the sign of @samp{a}. 16225zero depending on the sign of @samp{a}.
@@ -16243,7 +16237,7 @@ matrix, it computes the inverse of that matrix.
16243@tindex sqrt 16237@tindex sqrt
16244The @kbd{Q} (@code{calc-sqrt}) [@code{sqrt}] command computes the square 16238The @kbd{Q} (@code{calc-sqrt}) [@code{sqrt}] command computes the square
16245root of a number. For a negative real argument, the result will be a 16239root of a number. For a negative real argument, the result will be a
16246complex number whose form is determined by the current Polar Mode. 16240complex number whose form is determined by the current Polar mode.
16247 16241
16248@kindex f h 16242@kindex f h
16249@pindex calc-hypot 16243@pindex calc-hypot
@@ -16288,7 +16282,7 @@ The @kbd{f M} (@code{calc-mant-part}) [@code{mant}] function extracts
16288the ``mantissa'' part @expr{m} of its floating-point argument; @kbd{f X} 16282the ``mantissa'' part @expr{m} of its floating-point argument; @kbd{f X}
16289(@code{calc-xpon-part}) [@code{xpon}] extracts the ``exponent'' part 16283(@code{calc-xpon-part}) [@code{xpon}] extracts the ``exponent'' part
16290@expr{e}. The original number is equal to 16284@expr{e}. The original number is equal to
16291@texline @tmath{m \times 10^e}, 16285@texline @math{m \times 10^e},
16292@infoline @expr{m * 10^e}, 16286@infoline @expr{m * 10^e},
16293where @expr{m} is in the interval @samp{[1.0 ..@: 10.0)} except that 16287where @expr{m} is in the interval @samp{[1.0 ..@: 10.0)} except that
16294@expr{m=e=0} if the original number is zero. For integers 16288@expr{m=e=0} if the original number is zero. For integers
@@ -16305,7 +16299,7 @@ The @kbd{f S} (@code{calc-scale-float}) [@code{scf}] function scales a number
16305by a given power of ten. Thus, @samp{scf(mant(x), xpon(x)) = x} for any 16299by a given power of ten. Thus, @samp{scf(mant(x), xpon(x)) = x} for any
16306real @samp{x}. The second argument must be an integer, but the first 16300real @samp{x}. The second argument must be an integer, but the first
16307may actually be any numeric value. For example, @samp{scf(5,-2) = 0.05} 16301may actually be any numeric value. For example, @samp{scf(5,-2) = 0.05}
16308or @samp{1:20} depending on the current Fraction Mode. 16302or @samp{1:20} depending on the current Fraction mode.
16309 16303
16310@kindex f [ 16304@kindex f [
16311@kindex f ] 16305@kindex f ]
@@ -16321,7 +16315,7 @@ For example, incrementing @samp{12.3456} when the current precision
16321is 6 digits yields @samp{12.3457}. If the current precision had been 16315is 6 digits yields @samp{12.3457}. If the current precision had been
163228 digits, the result would have been @samp{12.345601}. Incrementing 163168 digits, the result would have been @samp{12.345601}. Incrementing
16323@samp{0.0} produces 16317@samp{0.0} produces
16324@texline @tmath{10^{-p}}, 16318@texline @math{10^{-p}},
16325@infoline @expr{10^-p}, 16319@infoline @expr{10^-p},
16326where @expr{p} is the current 16320where @expr{p} is the current
16327precision. These operations are defined only on integers and floats. 16321precision. These operations are defined only on integers and floats.
@@ -16362,7 +16356,7 @@ expressed as an integer-valued floating-point number.
16362The @kbd{F} (@code{calc-floor}) [@code{floor} or @code{ffloor}] command 16356The @kbd{F} (@code{calc-floor}) [@code{floor} or @code{ffloor}] command
16363truncates a real number to the next lower integer, i.e., toward minus 16357truncates a real number to the next lower integer, i.e., toward minus
16364infinity. Thus @kbd{3.6 F} produces 3, but @kbd{_3.6 F} produces 16358infinity. Thus @kbd{3.6 F} produces 3, but @kbd{_3.6 F} produces
16365@i{-4}. 16359@mathit{-4}.
16366 16360
16367@kindex I F 16361@kindex I F
16368@pindex calc-ceiling 16362@pindex calc-ceiling
@@ -16374,7 +16368,7 @@ infinity. Thus @kbd{3.6 F} produces 3, but @kbd{_3.6 F} produces
16374@kindex H I F 16368@kindex H I F
16375The @kbd{I F} (@code{calc-ceiling}) [@code{ceil} or @code{fceil}] 16369The @kbd{I F} (@code{calc-ceiling}) [@code{ceil} or @code{fceil}]
16376command truncates toward positive infinity. Thus @kbd{3.6 I F} produces 16370command truncates toward positive infinity. Thus @kbd{3.6 I F} produces
163774, and @kbd{_3.6 I F} produces @i{-3}. 163714, and @kbd{_3.6 I F} produces @mathit{-3}.
16378 16372
16379@kindex R 16373@kindex R
16380@pindex calc-round 16374@pindex calc-round
@@ -16388,7 +16382,7 @@ The @kbd{R} (@code{calc-round}) [@code{round} or @code{fround}] command
16388rounds to the nearest integer. When the fractional part is .5 exactly, 16382rounds to the nearest integer. When the fractional part is .5 exactly,
16389this command rounds away from zero. (All other rounding in the 16383this command rounds away from zero. (All other rounding in the
16390Calculator uses this convention as well.) Thus @kbd{3.5 R} produces 4 16384Calculator uses this convention as well.) Thus @kbd{3.5 R} produces 4
16391but @kbd{3.4 R} produces 3; @kbd{_3.5 R} produces @i{-4}. 16385but @kbd{3.4 R} produces 3; @kbd{_3.5 R} produces @mathit{-4}.
16392 16386
16393@kindex I R 16387@kindex I R
16394@pindex calc-trunc 16388@pindex calc-trunc
@@ -16401,7 +16395,7 @@ but @kbd{3.4 R} produces 3; @kbd{_3.5 R} produces @i{-4}.
16401The @kbd{I R} (@code{calc-trunc}) [@code{trunc} or @code{ftrunc}] 16395The @kbd{I R} (@code{calc-trunc}) [@code{trunc} or @code{ftrunc}]
16402command truncates toward zero. In other words, it ``chops off'' 16396command truncates toward zero. In other words, it ``chops off''
16403everything after the decimal point. Thus @kbd{3.6 I R} produces 3 and 16397everything after the decimal point. Thus @kbd{3.6 I R} produces 3 and
16404@kbd{_3.6 I R} produces @i{-3}. 16398@kbd{_3.6 I R} produces @mathit{-3}.
16405 16399
16406These functions may not be applied meaningfully to error forms, but they 16400These functions may not be applied meaningfully to error forms, but they
16407do work for intervals. As a convenience, applying @code{floor} to a 16401do work for intervals. As a convenience, applying @code{floor} to a
@@ -16479,17 +16473,17 @@ this command replaces each element by its complex conjugate.
16479The @kbd{G} (@code{calc-argument}) [@code{arg}] command computes the 16473The @kbd{G} (@code{calc-argument}) [@code{arg}] command computes the
16480``argument'' or polar angle of a complex number. For a number in polar 16474``argument'' or polar angle of a complex number. For a number in polar
16481notation, this is simply the second component of the pair 16475notation, this is simply the second component of the pair
16482@texline `@t{(}@var{r}@t{;}@tmath{\theta}@t{)}'. 16476@texline `@t{(}@var{r}@t{;}@math{\theta}@t{)}'.
16483@infoline `@t{(}@var{r}@t{;}@var{theta}@t{)}'. 16477@infoline `@t{(}@var{r}@t{;}@var{theta}@t{)}'.
16484The result is expressed according to the current angular mode and will 16478The result is expressed according to the current angular mode and will
16485be in the range @i{-180} degrees (exclusive) to @i{+180} degrees 16479be in the range @mathit{-180} degrees (exclusive) to @mathit{+180} degrees
16486(inclusive), or the equivalent range in radians. 16480(inclusive), or the equivalent range in radians.
16487 16481
16488@pindex calc-imaginary 16482@pindex calc-imaginary
16489The @code{calc-imaginary} command multiplies the number on the 16483The @code{calc-imaginary} command multiplies the number on the
16490top of the stack by the imaginary number @expr{i = (0,1)}. This 16484top of the stack by the imaginary number @expr{i = (0,1)}. This
16491command is not normally bound to a key in Calc, but it is available 16485command is not normally bound to a key in Calc, but it is available
16492on the @key{IMAG} button in Keypad Mode. 16486on the @key{IMAG} button in Keypad mode.
16493 16487
16494@kindex f r 16488@kindex f r
16495@pindex calc-re 16489@pindex calc-re
@@ -16513,8 +16507,8 @@ or matrix argument, these functions operate element-wise.
16513@pindex calc-pack 16507@pindex calc-pack
16514The @kbd{v p} (@code{calc-pack}) command can pack the top two numbers on 16508The @kbd{v p} (@code{calc-pack}) command can pack the top two numbers on
16515the stack into a composite object such as a complex number. With 16509the stack into a composite object such as a complex number. With
16516a prefix argument of @i{-1}, it produces a rectangular complex number; 16510a prefix argument of @mathit{-1}, it produces a rectangular complex number;
16517with an argument of @i{-2}, it produces a polar complex number. 16511with an argument of @mathit{-2}, it produces a polar complex number.
16518(Also, @pxref{Building Vectors}.) 16512(Also, @pxref{Building Vectors}.)
16519 16513
16520@ignore 16514@ignore
@@ -16638,7 +16632,7 @@ already a polar complex number, it uses @code{rect} instead. The
16638The @kbd{c c} (@code{calc-clean}) [@code{pclean}] command ``cleans'' the 16632The @kbd{c c} (@code{calc-clean}) [@code{pclean}] command ``cleans'' the
16639number on the top of the stack. Floating point numbers are re-rounded 16633number on the top of the stack. Floating point numbers are re-rounded
16640according to the current precision. Polar numbers whose angular 16634according to the current precision. Polar numbers whose angular
16641components have strayed from the @i{-180} to @i{+180} degree range 16635components have strayed from the @mathit{-180} to @mathit{+180} degree range
16642are normalized. (Note that results will be undesirable if the current 16636are normalized. (Note that results will be undesirable if the current
16643angular mode is different from the one under which the number was 16637angular mode is different from the one under which the number was
16644produced!) Integers and fractions are generally unaffected by this 16638produced!) Integers and fractions are generally unaffected by this
@@ -16894,8 +16888,8 @@ of the input date form are lost. With a numeric prefix argument
16894@var{n} in the range from 1 to 366, @kbd{t Y} computes the 16888@var{n} in the range from 1 to 366, @kbd{t Y} computes the
16895@var{n}th day of the year (366 is treated as 365 in non-leap 16889@var{n}th day of the year (366 is treated as 365 in non-leap
16896years). A prefix argument of 0 computes the last day of the 16890years). A prefix argument of 0 computes the last day of the
16897year (December 31). A negative prefix argument from @i{-1} to 16891year (December 31). A negative prefix argument from @mathit{-1} to
16898@i{-12} computes the first day of the @var{n}th month of the year. 16892@mathit{-12} computes the first day of the @var{n}th month of the year.
16899 16893
16900@kindex t W 16894@kindex t W
16901@pindex calc-new-week 16895@pindex calc-new-week
@@ -17264,7 +17258,7 @@ The Lisp variable @code{math-daylight-savings-hook} holds the
17264name of a function that is used to compute the daylight savings 17258name of a function that is used to compute the daylight savings
17265adjustment for a given date. The default is 17259adjustment for a given date. The default is
17266@code{math-std-daylight-savings}, which computes an adjustment 17260@code{math-std-daylight-savings}, which computes an adjustment
17267(either 0 or @i{-1}) using the North American rules given above. 17261(either 0 or @mathit{-1}) using the North American rules given above.
17268 17262
17269The daylight savings hook function is called with four arguments: 17263The daylight savings hook function is called with four arguments:
17270The date, as a floating-point number in standard Calc format; 17264The date, as a floating-point number in standard Calc format;
@@ -17312,7 +17306,7 @@ daylight savings hook:
17312@noindent 17306@noindent
17313The @code{bump} parameter is equal to zero when Calc is converting 17307The @code{bump} parameter is equal to zero when Calc is converting
17314from a date form in a generalized time zone into a GMT date value. 17308from a date form in a generalized time zone into a GMT date value.
17315It is @i{-1} when Calc is converting in the other direction. The 17309It is @mathit{-1} when Calc is converting in the other direction. The
17316adjustments shown above ensure that the conversion behaves correctly 17310adjustments shown above ensure that the conversion behaves correctly
17317and reasonably around the 2 a.m.@: transition in each direction. 17311and reasonably around the 2 a.m.@: transition in each direction.
17318 17312
@@ -17768,7 +17762,7 @@ formulas below for symbolic arguments only when you use the @kbd{a "}
17768integrals or solving equations involving the functions. 17762integrals or solving equations involving the functions.
17769 17763
17770@ifinfo 17764@ifinfo
17771These formulas are shown using the conventions of ``Big'' display 17765These formulas are shown using the conventions of Big display
17772mode (@kbd{d B}); for example, the formula for @code{fv} written 17766mode (@kbd{d B}); for example, the formula for @code{fv} written
17773linearly is @samp{pmt * ((1 + rate)^n) - 1) / rate}. 17767linearly is @samp{pmt * ((1 + rate)^n) - 1) / rate}.
17774 17768
@@ -17939,10 +17933,10 @@ particular, negative arguments are converted to positive integers modulo
17939 17933
17940If the word size is negative, binary operations produce 2's complement 17934If the word size is negative, binary operations produce 2's complement
17941integers from 17935integers from
17942@texline @tmath{-2^{-w-1}} 17936@texline @math{-2^{-w-1}}
17943@infoline @expr{-(2^(-w-1))} 17937@infoline @expr{-(2^(-w-1))}
17944to 17938to
17945@texline @tmath{2^{-w-1}-1} 17939@texline @math{2^{-w-1}-1}
17946@infoline @expr{2^(-w-1)-1} 17940@infoline @expr{2^(-w-1)-1}
17947inclusive. Either mode accepts inputs in any range; the sign of 17941inclusive. Either mode accepts inputs in any range; the sign of
17948@expr{w} affects only the results produced. 17942@expr{w} affects only the results produced.
@@ -17958,7 +17952,7 @@ addition do not use the current word size, since integer addition
17958generally is not ``binary.'' (However, @pxref{Simplification Modes}, 17952generally is not ``binary.'' (However, @pxref{Simplification Modes},
17959@code{calc-bin-simplify-mode}.) For example, with a word size of 8 17953@code{calc-bin-simplify-mode}.) For example, with a word size of 8
17960bits @kbd{b c} converts a number to the range 0 to 255; with a word 17954bits @kbd{b c} converts a number to the range 0 to 255; with a word
17961size of @i{-8} @kbd{b c} converts to the range @i{-128} to 127. 17955size of @mathit{-8} @kbd{b c} converts to the range @mathit{-128} to 127.
17962 17956
17963@kindex b w 17957@kindex b w
17964@pindex calc-word-size 17958@pindex calc-word-size
@@ -17974,7 +17968,7 @@ When the binary operations are written in symbolic form, they take an
17974optional second (or third) word-size parameter. When a formula like 17968optional second (or third) word-size parameter. When a formula like
17975@samp{and(a,b)} is finally evaluated, the word size current at that time 17969@samp{and(a,b)} is finally evaluated, the word size current at that time
17976will be used, but when @samp{and(a,b,-8)} is evaluated, a word size of 17970will be used, but when @samp{and(a,b,-8)} is evaluated, a word size of
17977@i{-8} will always be used. A symbolic binary function will be left 17971@mathit{-8} will always be used. A symbolic binary function will be left
17978in symbolic form unless the all of its argument(s) are integers or 17972in symbolic form unless the all of its argument(s) are integers or
17979integer-valued floats. 17973integer-valued floats.
17980 17974
@@ -18126,11 +18120,11 @@ One miscellaneous command is shift-@kbd{P} (@code{calc-pi}), which pushes
18126the value of @cpi{} (at the current precision) onto the stack. With the 18120the value of @cpi{} (at the current precision) onto the stack. With the
18127Hyperbolic flag, it pushes the value @expr{e}, the base of natural logarithms. 18121Hyperbolic flag, it pushes the value @expr{e}, the base of natural logarithms.
18128With the Inverse flag, it pushes Euler's constant 18122With the Inverse flag, it pushes Euler's constant
18129@texline @tmath{\gamma} 18123@texline @math{\gamma}
18130@infoline @expr{gamma} 18124@infoline @expr{gamma}
18131(about 0.5772). With both Inverse and Hyperbolic, it 18125(about 0.5772). With both Inverse and Hyperbolic, it
18132pushes the ``golden ratio'' 18126pushes the ``golden ratio''
18133@texline @tmath{\phi} 18127@texline @math{\phi}
18134@infoline @expr{phi} 18128@infoline @expr{phi}
18135(about 1.618). (At present, Euler's constant is not available 18129(about 1.618). (At present, Euler's constant is not available
18136to unlimited precision; Calc knows only the first 100 digits.) 18130to unlimited precision; Calc knows only the first 100 digits.)
@@ -18210,7 +18204,7 @@ The @kbd{H L} (@code{calc-log10}) [@code{log10}] command computes the common
18210it raises ten to a given power.) Note that the common logarithm of a 18204it raises ten to a given power.) Note that the common logarithm of a
18211complex number is computed by taking the natural logarithm and dividing 18205complex number is computed by taking the natural logarithm and dividing
18212by 18206by
18213@texline @tmath{\ln10}. 18207@texline @math{\ln10}.
18214@infoline @expr{ln(10)}. 18208@infoline @expr{ln(10)}.
18215 18209
18216@kindex B 18210@kindex B
@@ -18220,11 +18214,11 @@ by
18220@tindex alog 18214@tindex alog
18221The @kbd{B} (@code{calc-log}) [@code{log}] command computes a logarithm 18215The @kbd{B} (@code{calc-log}) [@code{log}] command computes a logarithm
18222to any base. For example, @kbd{1024 @key{RET} 2 B} produces 10, since 18216to any base. For example, @kbd{1024 @key{RET} 2 B} produces 10, since
18223@texline @tmath{2^{10} = 1024}. 18217@texline @math{2^{10} = 1024}.
18224@infoline @expr{2^10 = 1024}. 18218@infoline @expr{2^10 = 1024}.
18225In certain cases like @samp{log(3,9)}, the result 18219In certain cases like @samp{log(3,9)}, the result
18226will be either @expr{1:2} or @expr{0.5} depending on the current Fraction 18220will be either @expr{1:2} or @expr{0.5} depending on the current Fraction
18227Mode setting. With the Inverse flag [@code{alog}], this command is 18221mode setting. With the Inverse flag [@code{alog}], this command is
18228similar to @kbd{^} except that the order of the arguments is reversed. 18222similar to @kbd{^} except that the order of the arguments is reversed.
18229 18223
18230@kindex f I 18224@kindex f I
@@ -18242,11 +18236,11 @@ integer arithmetic is used; otherwise, this is equivalent to
18242@pindex calc-expm1 18236@pindex calc-expm1
18243@tindex expm1 18237@tindex expm1
18244The @kbd{f E} (@code{calc-expm1}) [@code{expm1}] command computes 18238The @kbd{f E} (@code{calc-expm1}) [@code{expm1}] command computes
18245@texline @tmath{e^x - 1}, 18239@texline @math{e^x - 1},
18246@infoline @expr{exp(x)-1}, 18240@infoline @expr{exp(x)-1},
18247but using an algorithm that produces a more accurate 18241but using an algorithm that produces a more accurate
18248answer when the result is close to zero, i.e., when 18242answer when the result is close to zero, i.e., when
18249@texline @tmath{e^x} 18243@texline @math{e^x}
18250@infoline @expr{exp(x)} 18244@infoline @expr{exp(x)}
18251is close to one. 18245is close to one.
18252 18246
@@ -18254,7 +18248,7 @@ is close to one.
18254@pindex calc-lnp1 18248@pindex calc-lnp1
18255@tindex lnp1 18249@tindex lnp1
18256The @kbd{f L} (@code{calc-lnp1}) [@code{lnp1}] command computes 18250The @kbd{f L} (@code{calc-lnp1}) [@code{lnp1}] command computes
18257@texline @tmath{\ln(x+1)}, 18251@texline @math{\ln(x+1)},
18258@infoline @expr{ln(x+1)}, 18252@infoline @expr{ln(x+1)},
18259producing a more accurate answer when @expr{x} is close to zero. 18253producing a more accurate answer when @expr{x} is close to zero.
18260 18254
@@ -18280,7 +18274,7 @@ of the current angular mode. @xref{Basic Operations on Units}.
18280Also, the symbolic variable @code{pi} is not ordinarily recognized in 18274Also, the symbolic variable @code{pi} is not ordinarily recognized in
18281arguments to trigonometric functions, as in @samp{sin(3 pi / 4)}, but 18275arguments to trigonometric functions, as in @samp{sin(3 pi / 4)}, but
18282the @kbd{a s} (@code{calc-simplify}) command recognizes many such 18276the @kbd{a s} (@code{calc-simplify}) command recognizes many such
18283formulas when the current angular mode is radians @emph{and} symbolic 18277formulas when the current angular mode is Radians @emph{and} Symbolic
18284mode is enabled; this example would be replaced by @samp{sqrt(2) / 2}. 18278mode is enabled; this example would be replaced by @samp{sqrt(2) / 2}.
18285@xref{Symbolic Mode}. Beware, this simplification occurs even if you 18279@xref{Symbolic Mode}. Beware, this simplification occurs even if you
18286have stored a different value in the variable @samp{pi}; this is one 18280have stored a different value in the variable @samp{pi}; this is one
@@ -18289,7 +18283,7 @@ the form @expr{x} plus a multiple of @cpiover{2} are also simplified.
18289Calc includes similar formulas for @code{cos} and @code{tan}. 18283Calc includes similar formulas for @code{cos} and @code{tan}.
18290 18284
18291The @kbd{a s} command knows all angles which are integer multiples of 18285The @kbd{a s} command knows all angles which are integer multiples of
18292@cpiover{12}, @cpiover{10}, or @cpiover{8} radians. In degrees mode, 18286@cpiover{12}, @cpiover{10}, or @cpiover{8} radians. In Degrees mode,
18293analogous simplifications occur for integer multiples of 15 or 18 18287analogous simplifications occur for integer multiples of 15 or 18
18294degrees, and for arguments plus multiples of 90 degrees. 18288degrees, and for arguments plus multiples of 90 degrees.
18295 18289
@@ -18388,10 +18382,10 @@ variants of these functions.
18388@tindex arctan2 18382@tindex arctan2
18389The @kbd{f T} (@code{calc-arctan2}) [@code{arctan2}] command takes two 18383The @kbd{f T} (@code{calc-arctan2}) [@code{arctan2}] command takes two
18390numbers from the stack and computes the arc tangent of their ratio. The 18384numbers from the stack and computes the arc tangent of their ratio. The
18391result is in the full range from @i{-180} (exclusive) to @i{+180} 18385result is in the full range from @mathit{-180} (exclusive) to @mathit{+180}
18392(inclusive) degrees, or the analogous range in radians. A similar 18386(inclusive) degrees, or the analogous range in radians. A similar
18393result would be obtained with @kbd{/} followed by @kbd{I T}, but the 18387result would be obtained with @kbd{/} followed by @kbd{I T}, but the
18394value would only be in the range from @i{-90} to @i{+90} degrees 18388value would only be in the range from @mathit{-90} to @mathit{+90} degrees
18395since the division loses information about the signs of the two 18389since the division loses information about the signs of the two
18396components, and an error might result from an explicit division by zero 18390components, and an error might result from an explicit division by zero
18397which @code{arctan2} would avoid. By (arbitrary) definition, 18391which @code{arctan2} would avoid. By (arbitrary) definition,
@@ -18440,7 +18434,7 @@ gamma function. For positive integer arguments, this is related to the
18440factorial function: @samp{gamma(n+1) = fact(n)}. For general complex 18434factorial function: @samp{gamma(n+1) = fact(n)}. For general complex
18441arguments the gamma function can be defined by the following definite 18435arguments the gamma function can be defined by the following definite
18442integral: 18436integral:
18443@texline @tmath{\Gamma(a) = \int_0^\infty t^{a-1} e^t dt}. 18437@texline @math{\Gamma(a) = \int_0^\infty t^{a-1} e^t dt}.
18444@infoline @expr{gamma(a) = integ(t^(a-1) exp(t), t, 0, inf)}. 18438@infoline @expr{gamma(a) = integ(t^(a-1) exp(t), t, 0, inf)}.
18445(The actual implementation uses far more efficient computational methods.) 18439(The actual implementation uses far more efficient computational methods.)
18446 18440
@@ -18474,7 +18468,7 @@ integral:
18474The @kbd{f G} (@code{calc-inc-gamma}) [@code{gammaP}] command computes 18468The @kbd{f G} (@code{calc-inc-gamma}) [@code{gammaP}] command computes
18475the incomplete gamma function, denoted @samp{P(a,x)}. This is defined by 18469the incomplete gamma function, denoted @samp{P(a,x)}. This is defined by
18476the integral, 18470the integral,
18477@texline @tmath{P(a,x) = \left( \int_0^x t^{a-1} e^t dt \right) / \Gamma(a)}. 18471@texline @math{P(a,x) = \left( \int_0^x t^{a-1} e^t dt \right) / \Gamma(a)}.
18478@infoline @expr{gammaP(a,x) = integ(t^(a-1) exp(t), t, 0, x) / gamma(a)}. 18472@infoline @expr{gammaP(a,x) = integ(t^(a-1) exp(t), t, 0, x) / gamma(a)}.
18479This implies that @samp{gammaP(a,inf) = 1} for any @expr{a} (see the 18473This implies that @samp{gammaP(a,inf) = 1} for any @expr{a} (see the
18480definition of the normal gamma function). 18474definition of the normal gamma function).
@@ -18507,10 +18501,10 @@ You can obtain these using the \kbd{H f G} [\code{gammag}] and
18507@tindex beta 18501@tindex beta
18508The @kbd{f b} (@code{calc-beta}) [@code{beta}] command computes the 18502The @kbd{f b} (@code{calc-beta}) [@code{beta}] command computes the
18509Euler beta function, which is defined in terms of the gamma function as 18503Euler beta function, which is defined in terms of the gamma function as
18510@texline @tmath{B(a,b) = \Gamma(a) \Gamma(b) / \Gamma(a+b)}, 18504@texline @math{B(a,b) = \Gamma(a) \Gamma(b) / \Gamma(a+b)},
18511@infoline @expr{beta(a,b) = gamma(a) gamma(b) / gamma(a+b)}, 18505@infoline @expr{beta(a,b) = gamma(a) gamma(b) / gamma(a+b)},
18512or by 18506or by
18513@texline @tmath{B(a,b) = \int_0^1 t^{a-1} (1-t)^{b-1} dt}. 18507@texline @math{B(a,b) = \int_0^1 t^{a-1} (1-t)^{b-1} dt}.
18514@infoline @expr{beta(a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, 1)}. 18508@infoline @expr{beta(a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, 1)}.
18515 18509
18516@kindex f B 18510@kindex f B
@@ -18520,7 +18514,7 @@ or by
18520@tindex betaB 18514@tindex betaB
18521The @kbd{f B} (@code{calc-inc-beta}) [@code{betaI}] command computes 18515The @kbd{f B} (@code{calc-inc-beta}) [@code{betaI}] command computes
18522the incomplete beta function @expr{I(x,a,b)}. It is defined by 18516the incomplete beta function @expr{I(x,a,b)}. It is defined by
18523@texline @tmath{I(x,a,b) = \left( \int_0^x t^{a-1} (1-t)^{b-1} dt \right) / B(a,b)}. 18517@texline @math{I(x,a,b) = \left( \int_0^x t^{a-1} (1-t)^{b-1} dt \right) / B(a,b)}.
18524@infoline @expr{betaI(x,a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, x) / beta(a,b)}. 18518@infoline @expr{betaI(x,a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, x) / beta(a,b)}.
18525Once again, the @kbd{H} (hyperbolic) prefix gives the corresponding 18519Once again, the @kbd{H} (hyperbolic) prefix gives the corresponding
18526un-normalized version [@code{betaB}]. 18520un-normalized version [@code{betaB}].
@@ -18532,11 +18526,11 @@ un-normalized version [@code{betaB}].
18532@tindex erfc 18526@tindex erfc
18533The @kbd{f e} (@code{calc-erf}) [@code{erf}] command computes the 18527The @kbd{f e} (@code{calc-erf}) [@code{erf}] command computes the
18534error function 18528error function
18535@texline @tmath{\hbox{erf}(x) = {2 \over \sqrt{\pi}} \int_0^x e^{-t^2} dt}. 18529@texline @math{\hbox{erf}(x) = {2 \over \sqrt{\pi}} \int_0^x e^{-t^2} dt}.
18536@infoline @expr{erf(x) = 2 integ(exp(-(t^2)), t, 0, x) / sqrt(pi)}. 18530@infoline @expr{erf(x) = 2 integ(exp(-(t^2)), t, 0, x) / sqrt(pi)}.
18537The complementary error function @kbd{I f e} (@code{calc-erfc}) [@code{erfc}] 18531The complementary error function @kbd{I f e} (@code{calc-erfc}) [@code{erfc}]
18538is the corresponding integral from @samp{x} to infinity; the sum 18532is the corresponding integral from @samp{x} to infinity; the sum
18539@texline @tmath{\hbox{erf}(x) + \hbox{erfc}(x) = 1}. 18533@texline @math{\hbox{erf}(x) + \hbox{erfc}(x) = 1}.
18540@infoline @expr{erf(x) + erfc(x) = 1}. 18534@infoline @expr{erf(x) + erfc(x) = 1}.
18541 18535
18542@kindex f j 18536@kindex f j
@@ -18612,17 +18606,17 @@ occurrence of @code{eps} may stand for a different small value.
18612 18606
18613For @samp{z1^z2}: This is defined by @samp{exp(ln(z1)*z2)}. 18607For @samp{z1^z2}: This is defined by @samp{exp(ln(z1)*z2)}.
18614One interesting consequence of this is that @samp{(-8)^1:3} does 18608One interesting consequence of this is that @samp{(-8)^1:3} does
18615not evaluate to @i{-2} as you might expect, but to the complex 18609not evaluate to @mathit{-2} as you might expect, but to the complex
18616number @expr{(1., 1.732)}. Both of these are valid cube roots 18610number @expr{(1., 1.732)}. Both of these are valid cube roots
18617of @i{-8} (as is @expr{(1., -1.732)}); Calc chooses a perhaps 18611of @mathit{-8} (as is @expr{(1., -1.732)}); Calc chooses a perhaps
18618less-obvious root for the sake of mathematical consistency. 18612less-obvious root for the sake of mathematical consistency.
18619 18613
18620For @samp{arcsin(z)}: This is defined by @samp{-i*ln(i*z + sqrt(1-z^2))}. 18614For @samp{arcsin(z)}: This is defined by @samp{-i*ln(i*z + sqrt(1-z^2))}.
18621The branch cuts are on the real axis, less than @i{-1} and greater than 1. 18615The branch cuts are on the real axis, less than @mathit{-1} and greater than 1.
18622 18616
18623For @samp{arccos(z)}: This is defined by @samp{-i*ln(z + i*sqrt(1-z^2))}, 18617For @samp{arccos(z)}: This is defined by @samp{-i*ln(z + i*sqrt(1-z^2))},
18624or equivalently by @samp{pi/2 - arcsin(z)}. The branch cuts are on 18618or equivalently by @samp{pi/2 - arcsin(z)}. The branch cuts are on
18625the real axis, less than @i{-1} and greater than 1. 18619the real axis, less than @mathit{-1} and greater than 1.
18626 18620
18627For @samp{arctan(z)}: This is defined by 18621For @samp{arctan(z)}: This is defined by
18628@samp{(ln(1+i*z) - ln(1-i*z)) / (2*i)}. The branch cuts are on the 18622@samp{(ln(1+i*z) - ln(1-i*z)) / (2*i)}. The branch cuts are on the
@@ -18637,10 +18631,10 @@ For @samp{arccosh(z)}: This is defined by
18637real axis less than 1. 18631real axis less than 1.
18638 18632
18639For @samp{arctanh(z)}: This is defined by @samp{(ln(1+z) - ln(1-z)) / 2}. 18633For @samp{arctanh(z)}: This is defined by @samp{(ln(1+z) - ln(1-z)) / 2}.
18640The branch cuts are on the real axis, less than @i{-1} and greater than 1. 18634The branch cuts are on the real axis, less than @mathit{-1} and greater than 1.
18641 18635
18642The following tables for @code{arcsin}, @code{arccos}, and 18636The following tables for @code{arcsin}, @code{arccos}, and
18643@code{arctan} assume the current angular mode is radians. The 18637@code{arctan} assume the current angular mode is Radians. The
18644hyperbolic functions operate independently of the angular mode. 18638hyperbolic functions operate independently of the angular mode.
18645 18639
18646@smallexample 18640@smallexample
@@ -18710,7 +18704,7 @@ random numbers of various sorts.
18710 18704
18711Given a positive numeric prefix argument @expr{M}, it produces a random 18705Given a positive numeric prefix argument @expr{M}, it produces a random
18712integer @expr{N} in the range 18706integer @expr{N} in the range
18713@texline @tmath{0 \le N < M}. 18707@texline @math{0 \le N < M}.
18714@infoline @expr{0 <= N < M}. 18708@infoline @expr{0 <= N < M}.
18715Each of the @expr{M} values appears with equal probability. 18709Each of the @expr{M} values appears with equal probability.
18716 18710
@@ -18720,15 +18714,15 @@ the result is a random integer less than @expr{M}. However, note that
18720while numeric prefix arguments are limited to six digits or so, an @expr{M} 18714while numeric prefix arguments are limited to six digits or so, an @expr{M}
18721taken from the stack can be arbitrarily large. If @expr{M} is negative, 18715taken from the stack can be arbitrarily large. If @expr{M} is negative,
18722the result is a random integer in the range 18716the result is a random integer in the range
18723@texline @tmath{M < N \le 0}. 18717@texline @math{M < N \le 0}.
18724@infoline @expr{M < N <= 0}. 18718@infoline @expr{M < N <= 0}.
18725 18719
18726If the value on the stack is a floating-point number @expr{M}, the result 18720If the value on the stack is a floating-point number @expr{M}, the result
18727is a random floating-point number @expr{N} in the range 18721is a random floating-point number @expr{N} in the range
18728@texline @tmath{0 \le N < M} 18722@texline @math{0 \le N < M}
18729@infoline @expr{0 <= N < M} 18723@infoline @expr{0 <= N < M}
18730or 18724or
18731@texline @tmath{M < N \le 0}, 18725@texline @math{M < N \le 0},
18732@infoline @expr{M < N <= 0}, 18726@infoline @expr{M < N <= 0},
18733according to the sign of @expr{M}. 18727according to the sign of @expr{M}.
18734 18728
@@ -18738,14 +18732,14 @@ of one. The algorithm used generates random numbers in pairs; thus,
18738every other call to this function will be especially fast. 18732every other call to this function will be especially fast.
18739 18733
18740If @expr{M} is an error form 18734If @expr{M} is an error form
18741@texline @tmath{m} @code{+/-} @tmath{\sigma} 18735@texline @math{m} @code{+/-} @math{\sigma}
18742@infoline @samp{m +/- s} 18736@infoline @samp{m +/- s}
18743where @var{m} and 18737where @var{m} and
18744@texline @tmath{\sigma} 18738@texline @math{\sigma}
18745@infoline @var{s} 18739@infoline @var{s}
18746are both real numbers, the result uses a Gaussian distribution with mean 18740are both real numbers, the result uses a Gaussian distribution with mean
18747@var{m} and standard deviation 18741@var{m} and standard deviation
18748@texline @tmath{\sigma}. 18742@texline @math{\sigma}.
18749@var{s}. 18743@var{s}.
18750 18744
18751If @expr{M} is an interval form, the lower and upper bounds specify the 18745If @expr{M} is an interval form, the lower and upper bounds specify the
@@ -18858,7 +18852,7 @@ generators that are typically used to implement @code{random}.
18858If @code{RandSeed} contains an integer, Calc uses this integer to 18852If @code{RandSeed} contains an integer, Calc uses this integer to
18859seed an ``additive congruential'' method (Knuth's algorithm 3.2.2A, 18853seed an ``additive congruential'' method (Knuth's algorithm 3.2.2A,
18860computing 18854computing
18861@texline @tmath{X_{n-55} - X_{n-24}}. 18855@texline @math{X_{n-55} - X_{n-24}}.
18862@infoline @expr{X_n-55 - X_n-24}). 18856@infoline @expr{X_n-55 - X_n-24}).
18863This method expands the seed 18857This method expands the seed
18864value into a large table which is maintained internally; the variable 18858value into a large table which is maintained internally; the variable
@@ -18894,20 +18888,20 @@ value.
18894 18888
18895To create a random floating-point number with precision @var{p}, Calc 18889To create a random floating-point number with precision @var{p}, Calc
18896simply creates a random @var{p}-digit integer and multiplies by 18890simply creates a random @var{p}-digit integer and multiplies by
18897@texline @tmath{10^{-p}}. 18891@texline @math{10^{-p}}.
18898@infoline @expr{10^-p}. 18892@infoline @expr{10^-p}.
18899The resulting random numbers should be very clean, but note 18893The resulting random numbers should be very clean, but note
18900that relatively small numbers will have few significant random digits. 18894that relatively small numbers will have few significant random digits.
18901In other words, with a precision of 12, you will occasionally get 18895In other words, with a precision of 12, you will occasionally get
18902numbers on the order of 18896numbers on the order of
18903@texline @tmath{10^{-9}} 18897@texline @math{10^{-9}}
18904@infoline @expr{10^-9} 18898@infoline @expr{10^-9}
18905or 18899or
18906@texline @tmath{10^{-10}}, 18900@texline @math{10^{-10}},
18907@infoline @expr{10^-10}, 18901@infoline @expr{10^-10},
18908but those numbers will only have two or three random digits since they 18902but those numbers will only have two or three random digits since they
18909correspond to small integers times 18903correspond to small integers times
18910@texline @tmath{10^{-12}}. 18904@texline @math{10^{-12}}.
18911@infoline @expr{10^-12}. 18905@infoline @expr{10^-12}.
18912 18906
18913To create a random integer in the interval @samp{[0 .. @var{m})}, Calc 18907To create a random integer in the interval @samp{[0 .. @var{m})}, Calc
@@ -18958,7 +18952,7 @@ numbers.
18958The @kbd{k E} (@code{calc-extended-gcd}) [@code{egcd}] command computes 18952The @kbd{k E} (@code{calc-extended-gcd}) [@code{egcd}] command computes
18959the GCD of two integers @expr{x} and @expr{y} and returns a vector 18953the GCD of two integers @expr{x} and @expr{y} and returns a vector
18960@expr{[g, a, b]} where 18954@expr{[g, a, b]} where
18961@texline @tmath{g = \gcd(x,y) = a x + b y}. 18955@texline @math{g = \gcd(x,y) = a x + b y}.
18962@infoline @expr{g = gcd(x,y) = a x + b y}. 18956@infoline @expr{g = gcd(x,y) = a x + b y}.
18963 18957
18964@kindex ! 18958@kindex !
@@ -19002,7 +18996,7 @@ on the top of the stack and @expr{N} is second-to-top. If both arguments
19002are integers, the result is an exact integer. Otherwise, the result is a 18996are integers, the result is an exact integer. Otherwise, the result is a
19003floating-point approximation. The binomial coefficient is defined for all 18997floating-point approximation. The binomial coefficient is defined for all
19004real numbers by 18998real numbers by
19005@texline @tmath{N! \over M! (N-M)!\,}. 18999@texline @math{N! \over M! (N-M)!\,}.
19006@infoline @expr{N! / M! (N-M)!}. 19000@infoline @expr{N! / M! (N-M)!}.
19007 19001
19008@kindex H k c 19002@kindex H k c
@@ -19045,11 +19039,11 @@ functions.
19045@tindex stir2 19039@tindex stir2
19046The @kbd{k s} (@code{calc-stirling-number}) [@code{stir1}] command 19040The @kbd{k s} (@code{calc-stirling-number}) [@code{stir1}] command
19047computes a Stirling number of the first 19041computes a Stirling number of the first
19048@texline kind@tie{}@tmath{n \brack m}, 19042@texline kind@tie{}@math{n \brack m},
19049@infoline kind, 19043@infoline kind,
19050given two integers @expr{n} and @expr{m} on the stack. The @kbd{H k s} 19044given two integers @expr{n} and @expr{m} on the stack. The @kbd{H k s}
19051[@code{stir2}] command computes a Stirling number of the second 19045[@code{stir2}] command computes a Stirling number of the second
19052@texline kind@tie{}@tmath{n \brace m}. 19046@texline kind@tie{}@math{n \brace m}.
19053@infoline kind. 19047@infoline kind.
19054These are the number of @expr{m}-cycle permutations of @expr{n} objects, 19048These are the number of @expr{m}-cycle permutations of @expr{n} objects,
19055and the number of ways to partition @expr{n} objects into @expr{m} 19049and the number of ways to partition @expr{n} objects into @expr{m}
@@ -19093,8 +19087,8 @@ result is a vector of the prime factors in increasing order. For larger
19093inputs, prime factors above 5000 may not be found, in which case the 19087inputs, prime factors above 5000 may not be found, in which case the
19094last number in the vector will be an unfactored integer greater than 25 19088last number in the vector will be an unfactored integer greater than 25
19095million (with a warning message). For negative integers, the first 19089million (with a warning message). For negative integers, the first
19096element of the list will be @i{-1}. For inputs @i{-1}, @i{0}, and 19090element of the list will be @mathit{-1}. For inputs @mathit{-1}, @mathit{0}, and
19097@i{1}, the result is a list of the same number. 19091@mathit{1}, the result is a list of the same number.
19098 19092
19099@kindex k n 19093@kindex k n
19100@pindex calc-next-prime 19094@pindex calc-next-prime
@@ -19128,7 +19122,7 @@ analogously finds the next prime less than a given number.
19128@tindex totient 19122@tindex totient
19129The @kbd{k t} (@code{calc-totient}) [@code{totient}] command computes the 19123The @kbd{k t} (@code{calc-totient}) [@code{totient}] command computes the
19130Euler ``totient'' 19124Euler ``totient''
19131@texline function@tie{}@tmath{\phi(n)}, 19125@texline function@tie{}@math{\phi(n)},
19132@infoline function, 19126@infoline function,
19133the number of integers less than @expr{n} which 19127the number of integers less than @expr{n} which
19134are relatively prime to @expr{n}. 19128are relatively prime to @expr{n}.
@@ -19137,7 +19131,7 @@ are relatively prime to @expr{n}.
19137@pindex calc-moebius 19131@pindex calc-moebius
19138@tindex moebius 19132@tindex moebius
19139The @kbd{k m} (@code{calc-moebius}) [@code{moebius}] command computes the 19133The @kbd{k m} (@code{calc-moebius}) [@code{moebius}] command computes the
19140@texline M@"obius @tmath{\mu} 19134@texline M@"obius @math{\mu}
19141@infoline Moebius ``mu'' 19135@infoline Moebius ``mu''
19142function. If the input number is a product of @expr{k} 19136function. If the input number is a product of @expr{k}
19143distinct factors, this is @expr{(-1)^k}. If the input number has any 19137distinct factors, this is @expr{(-1)^k}. If the input number has any
@@ -19201,7 +19195,7 @@ recover the original arguments but substitute a new value for @expr{x}.)
19201@end ignore 19195@end ignore
19202@tindex ltpc 19196@tindex ltpc
19203The @samp{utpc(x,v)} function uses the chi-square distribution with 19197The @samp{utpc(x,v)} function uses the chi-square distribution with
19204@texline @tmath{\nu} 19198@texline @math{\nu}
19205@infoline @expr{v} 19199@infoline @expr{v}
19206degrees of freedom. It is the probability that a model is 19200degrees of freedom. It is the probability that a model is
19207correct if its chi-square statistic is @expr{x}. 19201correct if its chi-square statistic is @expr{x}.
@@ -19219,10 +19213,10 @@ correct if its chi-square statistic is @expr{x}.
19219@tindex ltpf 19213@tindex ltpf
19220The @samp{utpf(F,v1,v2)} function uses the F distribution, used in 19214The @samp{utpf(F,v1,v2)} function uses the F distribution, used in
19221various statistical tests. The parameters 19215various statistical tests. The parameters
19222@texline @tmath{\nu_1} 19216@texline @math{\nu_1}
19223@infoline @expr{v1} 19217@infoline @expr{v1}
19224and 19218and
19225@texline @tmath{\nu_2} 19219@texline @math{\nu_2}
19226@infoline @expr{v2} 19220@infoline @expr{v2}
19227are the degrees of freedom in the numerator and denominator, 19221are the degrees of freedom in the numerator and denominator,
19228respectively, used in computing the statistic @expr{F}. 19222respectively, used in computing the statistic @expr{F}.
@@ -19240,7 +19234,7 @@ respectively, used in computing the statistic @expr{F}.
19240@tindex ltpn 19234@tindex ltpn
19241The @samp{utpn(x,m,s)} function uses a normal (Gaussian) distribution 19235The @samp{utpn(x,m,s)} function uses a normal (Gaussian) distribution
19242with mean @expr{m} and standard deviation 19236with mean @expr{m} and standard deviation
19243@texline @tmath{\sigma}. 19237@texline @math{\sigma}.
19244@infoline @expr{s}. 19238@infoline @expr{s}.
19245It is the probability that such a normal-distributed random variable 19239It is the probability that such a normal-distributed random variable
19246would exceed @expr{x}. 19240would exceed @expr{x}.
@@ -19273,18 +19267,18 @@ Poisson random events will occur.
19273@tindex ltpt 19267@tindex ltpt
19274The @samp{utpt(t,v)} function uses the Student's ``t'' distribution 19268The @samp{utpt(t,v)} function uses the Student's ``t'' distribution
19275with 19269with
19276@texline @tmath{\nu} 19270@texline @math{\nu}
19277@infoline @expr{v} 19271@infoline @expr{v}
19278degrees of freedom. It is the probability that a 19272degrees of freedom. It is the probability that a
19279t-distributed random variable will be greater than @expr{t}. 19273t-distributed random variable will be greater than @expr{t}.
19280(Note: This computes the distribution function 19274(Note: This computes the distribution function
19281@texline @tmath{A(t|\nu)} 19275@texline @math{A(t|\nu)}
19282@infoline @expr{A(t|v)} 19276@infoline @expr{A(t|v)}
19283where 19277where
19284@texline @tmath{A(0|\nu) = 1} 19278@texline @math{A(0|\nu) = 1}
19285@infoline @expr{A(0|v) = 1} 19279@infoline @expr{A(0|v) = 1}
19286and 19280and
19287@texline @tmath{A(\infty|\nu) \to 0}. 19281@texline @math{A(\infty|\nu) \to 0}.
19288@infoline @expr{A(inf|v) -> 0}. 19282@infoline @expr{A(inf|v) -> 0}.
19289The @code{UTPT} operation on the HP-48 uses a different definition which 19283The @code{UTPT} operation on the HP-48 uses a different definition which
19290returns half of Calc's value: @samp{UTPT(t,v) = .5*utpt(t,v)}.) 19284returns half of Calc's value: @samp{UTPT(t,v) = .5*utpt(t,v)}.)
@@ -19404,8 +19398,8 @@ integer, is the exponent. The result is the mantissa
19404times ten to the power of the exponent. 19398times ten to the power of the exponent.
19405 19399
19406@item -12 19400@item -12
19407This is treated the same as @i{-11} by the @kbd{v p} command. 19401This is treated the same as @mathit{-11} by the @kbd{v p} command.
19408When unpacking, @i{-12} specifies that a floating-point mantissa 19402When unpacking, @mathit{-12} specifies that a floating-point mantissa
19409is desired. 19403is desired.
19410 19404
19411@item -13 19405@item -13
@@ -19444,7 +19438,7 @@ returned in the form @samp{[@w{[a, b, c]}, [d, e, f]]}.
19444If any elements of the vector are negative, other kinds of 19438If any elements of the vector are negative, other kinds of
19445packing are done at that level as described above. For 19439packing are done at that level as described above. For
19446example, @samp{[2, 3, -4]} takes 12 objects and creates a 19440example, @samp{[2, 3, -4]} takes 12 objects and creates a
19447@texline @tmath{2\times3} 19441@texline @math{2\times3}
19448@infoline 2x3 19442@infoline 2x3
19449matrix of error forms: @samp{[[a +/- b, c +/- d ... ]]}. 19443matrix of error forms: @samp{[[a +/- b, c +/- d ... ]]}.
19450Also, @samp{[-4, -10]} will convert four integers into an 19444Also, @samp{[-4, -10]} will convert four integers into an
@@ -19482,18 +19476,18 @@ the result of @kbd{C-u -4 v u} will be the two vectors
19482@samp{[a, c^2, d]} and @w{@samp{[b, 0, 7]}}. 19476@samp{[a, c^2, d]} and @w{@samp{[b, 0, 7]}}.
19483 19477
19484Note that the prefix argument can have an effect even when the input is 19478Note that the prefix argument can have an effect even when the input is
19485not a vector. For example, if the input is the number @i{-5}, then 19479not a vector. For example, if the input is the number @mathit{-5}, then
19486@kbd{c-u -1 v u} yields @i{-5} and 0 (the components of @i{-5} 19480@kbd{c-u -1 v u} yields @mathit{-5} and 0 (the components of @mathit{-5}
19487when viewed as a rectangular complex number); @kbd{C-u -2 v u} yields 5 19481when viewed as a rectangular complex number); @kbd{C-u -2 v u} yields 5
19488and 180 (assuming degrees mode); and @kbd{C-u -10 v u} yields @i{-5} 19482and 180 (assuming Degrees mode); and @kbd{C-u -10 v u} yields @mathit{-5}
19489and 1 (the numerator and denominator of @i{-5}, viewed as a rational 19483and 1 (the numerator and denominator of @mathit{-5}, viewed as a rational
19490number). Plain @kbd{v u} with this input would complain that the input 19484number). Plain @kbd{v u} with this input would complain that the input
19491is not a composite object. 19485is not a composite object.
19492 19486
19493Unpacking mode @i{-11} converts a float into an integer mantissa and 19487Unpacking mode @mathit{-11} converts a float into an integer mantissa and
19494an integer exponent, where the mantissa is not divisible by 10 19488an integer exponent, where the mantissa is not divisible by 10
19495(except that 0.0 is represented by a mantissa and exponent of 0). 19489(except that 0.0 is represented by a mantissa and exponent of 0).
19496Unpacking mode @i{-12} converts a float into a floating-point mantissa 19490Unpacking mode @mathit{-12} converts a float into a floating-point mantissa
19497and integer exponent, where the mantissa (for non-zero numbers) 19491and integer exponent, where the mantissa (for non-zero numbers)
19498is guaranteed to lie in the range [1 .. 10). In both cases, 19492is guaranteed to lie in the range [1 .. 10). In both cases,
19499the mantissa is shifted left or right (and the exponent adjusted 19493the mantissa is shifted left or right (and the exponent adjusted
@@ -19593,7 +19587,7 @@ the stack is a scalar, it is used for each element on the diagonal, and
19593the prefix argument is required. 19587the prefix argument is required.
19594 19588
19595To build a constant square matrix, e.g., a 19589To build a constant square matrix, e.g., a
19596@texline @tmath{3\times3} 19590@texline @math{3\times3}
19597@infoline 3x3 19591@infoline 3x3
19598matrix filled with ones, use @kbd{0 M-3 v d 1 +}, i.e., build a zero 19592matrix filled with ones, use @kbd{0 M-3 v d 1 +}, i.e., build a zero
19599matrix first and then add a constant value to that matrix. (Another 19593matrix first and then add a constant value to that matrix. (Another
@@ -19615,7 +19609,7 @@ such generic identity matrices, and if one is combined with a matrix
19615whose size is known, it is converted automatically to an identity 19609whose size is known, it is converted automatically to an identity
19616matrix of a suitable matching size. The @kbd{v i} command with an 19610matrix of a suitable matching size. The @kbd{v i} command with an
19617argument of zero creates a generic identity matrix, @samp{idn(1)}. 19611argument of zero creates a generic identity matrix, @samp{idn(1)}.
19618Note that in dimensioned matrix mode (@pxref{Matrix Mode}), generic 19612Note that in dimensioned Matrix mode (@pxref{Matrix Mode}), generic
19619identity matrices are immediately expanded to the current default 19613identity matrices are immediately expanded to the current default
19620dimensions. 19614dimensions.
19621 19615
@@ -19626,7 +19620,7 @@ The @kbd{v x} (@code{calc-index}) [@code{index}] function builds a vector
19626of consecutive integers from 1 to @var{n}, where @var{n} is the numeric 19620of consecutive integers from 1 to @var{n}, where @var{n} is the numeric
19627prefix argument. If you do not provide a prefix argument, you will be 19621prefix argument. If you do not provide a prefix argument, you will be
19628prompted to enter a suitable number. If @var{n} is negative, the result 19622prompted to enter a suitable number. If @var{n} is negative, the result
19629is a vector of negative integers from @var{n} to @i{-1}. 19623is a vector of negative integers from @var{n} to @mathit{-1}.
19630 19624
19631With a prefix argument of just @kbd{C-u}, the @kbd{v x} command takes 19625With a prefix argument of just @kbd{C-u}, the @kbd{v x} command takes
19632three values from the stack: @var{n}, @var{start}, and @var{incr} (with 19626three values from the stack: @var{n}, @var{start}, and @var{incr} (with
@@ -19819,7 +19813,7 @@ With the Hyperbolic flag, @kbd{H v l} [@code{mdims}] computes a vector
19819of the dimensions of a vector, matrix, or higher-order object. For 19813of the dimensions of a vector, matrix, or higher-order object. For
19820example, @samp{mdims([[a,b,c],[d,e,f]])} returns @samp{[2, 3]} since 19814example, @samp{mdims([[a,b,c],[d,e,f]])} returns @samp{[2, 3]} since
19821its argument is a 19815its argument is a
19822@texline @tmath{2\times3} 19816@texline @math{2\times3}
19823@infoline 2x3 19817@infoline 2x3
19824matrix. 19818matrix.
19825 19819
@@ -19851,13 +19845,13 @@ in the vector, the last row will be short and the result will not be
19851suitable for use as a matrix. For example, with the matrix 19845suitable for use as a matrix. For example, with the matrix
19852@samp{[[1, 2], @w{[3, 4]}]} on the stack, @kbd{v a 4} produces 19846@samp{[[1, 2], @w{[3, 4]}]} on the stack, @kbd{v a 4} produces
19853@samp{[[1, 2, 3, 4]]} (a 19847@samp{[[1, 2, 3, 4]]} (a
19854@texline @tmath{1\times4} 19848@texline @math{1\times4}
19855@infoline 1x4 19849@infoline 1x4
19856matrix), @kbd{v a 1} produces @samp{[[1], [2], [3], [4]]} (a 19850matrix), @kbd{v a 1} produces @samp{[[1], [2], [3], [4]]} (a
19857@texline @tmath{4\times1} 19851@texline @math{4\times1}
19858@infoline 4x1 19852@infoline 4x1
19859matrix), @kbd{v a 2} produces @samp{[[1, 2], [3, 4]]} (the original 19853matrix), @kbd{v a 2} produces @samp{[[1, 2], [3, 4]]} (the original
19860@texline @tmath{2\times2} 19854@texline @math{2\times2}
19861@infoline 2x2 19855@infoline 2x2
19862matrix), @w{@kbd{v a 3}} produces @samp{[[1, 2, 3], [4]]} (not a 19856matrix), @w{@kbd{v a 3}} produces @samp{[[1, 2, 3], [4]]} (not a
19863matrix), and @kbd{v a 0} produces the flattened list 19857matrix), and @kbd{v a 0} produces the flattened list
@@ -20177,10 +20171,10 @@ sets are disjoint, i.e., if they share no common elements, the result
20177will be the empty vector @samp{[]}. Note that the characters @kbd{V} 20171will be the empty vector @samp{[]}. Note that the characters @kbd{V}
20178and @kbd{^} were chosen to be close to the conventional mathematical 20172and @kbd{^} were chosen to be close to the conventional mathematical
20179notation for set 20173notation for set
20180@texline union@tie{}(@tmath{A \cup B}) 20174@texline union@tie{}(@math{A \cup B})
20181@infoline union 20175@infoline union
20182and 20176and
20183@texline intersection@tie{}(@tmath{A \cap B}). 20177@texline intersection@tie{}(@math{A \cap B}).
20184@infoline intersection. 20178@infoline intersection.
20185 20179
20186@kindex V - 20180@kindex V -
@@ -20289,7 +20283,7 @@ not include any negative numbers. The input is interpreted as a
20289set of integers in the sense of @kbd{V F} (@code{vfloor}). Beware 20283set of integers in the sense of @kbd{V F} (@code{vfloor}). Beware
20290that a simple input like @samp{[100]} can result in a huge integer 20284that a simple input like @samp{[100]} can result in a huge integer
20291representation 20285representation
20292@texline (@tmath{2^{100}}, a 31-digit integer, in this case). 20286@texline (@math{2^{100}}, a 31-digit integer, in this case).
20293@infoline (@expr{2^100}, a 31-digit integer, in this case). 20287@infoline (@expr{2^100}, a 31-digit integer, in this case).
20294 20288
20295@node Statistical Operations, Reducing and Mapping, Set Operations, Matrix Functions 20289@node Statistical Operations, Reducing and Mapping, Set Operations, Matrix Functions
@@ -20401,10 +20395,10 @@ plus or minus infinity.
20401The @kbd{u M} (@code{calc-vector-mean}) [@code{vmean}] command 20395The @kbd{u M} (@code{calc-vector-mean}) [@code{vmean}] command
20402computes the average (arithmetic mean) of the data values. 20396computes the average (arithmetic mean) of the data values.
20403If the inputs are error forms 20397If the inputs are error forms
20404@texline @tmath{x \pm \sigma}, 20398@texline @math{x \pm \sigma},
20405@infoline @samp{x +/- s}, 20399@infoline @samp{x +/- s},
20406this is the weighted mean of the @expr{x} values with weights 20400this is the weighted mean of the @expr{x} values with weights
20407@texline @tmath{1 /\sigma^2}. 20401@texline @math{1 /\sigma^2}.
20408@infoline @expr{1 / s^2}. 20402@infoline @expr{1 / s^2}.
20409@tex 20403@tex
20410\turnoffactive 20404\turnoffactive
@@ -20416,7 +20410,7 @@ values divided by the count of the values.
20416 20410
20417Note that a plain number can be considered an error form with 20411Note that a plain number can be considered an error form with
20418error 20412error
20419@texline @tmath{\sigma = 0}. 20413@texline @math{\sigma = 0}.
20420@infoline @expr{s = 0}. 20414@infoline @expr{s = 0}.
20421If the input to @kbd{u M} is a mixture of 20415If the input to @kbd{u M} is a mixture of
20422plain numbers and error forms, the result is the mean of the 20416plain numbers and error forms, the result is the mean of the
@@ -20525,7 +20519,7 @@ for a vector of numbers simply by using the @kbd{A} command.
20525@cindex Sample statistics 20519@cindex Sample statistics
20526The @kbd{u S} (@code{calc-vector-sdev}) [@code{vsdev}] command 20520The @kbd{u S} (@code{calc-vector-sdev}) [@code{vsdev}] command
20527computes the standard 20521computes the standard
20528@texline deviation@tie{}@tmath{\sigma} 20522@texline deviation@tie{}@math{\sigma}
20529@infoline deviation 20523@infoline deviation
20530of the data values. If the values are error forms, the errors are used 20524of the data values. If the values are error forms, the errors are used
20531as weights just as for @kbd{u M}. This is the @emph{sample} standard 20525as weights just as for @kbd{u M}. This is the @emph{sample} standard
@@ -20541,7 +20535,7 @@ This function also applies to distributions. The standard deviation
20541of a single error form is simply the error part. The standard deviation 20535of a single error form is simply the error part. The standard deviation
20542of a continuous interval happens to equal the difference between the 20536of a continuous interval happens to equal the difference between the
20543limits, divided by 20537limits, divided by
20544@texline @tmath{\sqrt{12}}. 20538@texline @math{\sqrt{12}}.
20545@infoline @expr{sqrt(12)}. 20539@infoline @expr{sqrt(12)}.
20546The standard deviation of an integer interval is the same as the 20540The standard deviation of an integer interval is the same as the
20547standard deviation of a vector of those integers. 20541standard deviation of a vector of those integers.
@@ -20579,7 +20573,7 @@ The @kbd{H u S} (@code{calc-vector-variance}) [@code{vvar}] and
20579@kbd{H I u S} (@code{calc-vector-pop-variance}) [@code{vpvar}] 20573@kbd{H I u S} (@code{calc-vector-pop-variance}) [@code{vpvar}]
20580commands compute the variance of the data values. The variance 20574commands compute the variance of the data values. The variance
20581is the 20575is the
20582@texline square@tie{}@tmath{\sigma^2} 20576@texline square@tie{}@math{\sigma^2}
20583@infoline square 20577@infoline square
20584of the standard deviation, i.e., the sum of the 20578of the standard deviation, i.e., the sum of the
20585squares of the deviations of the data values from the mean. 20579squares of the deviations of the data values from the mean.
@@ -20603,7 +20597,7 @@ vectors of equal size. The vectors are each flattened in the same
20603way as by the single-variable statistical functions. Given a numeric 20597way as by the single-variable statistical functions. Given a numeric
20604prefix argument of 1, these functions instead take one object from 20598prefix argument of 1, these functions instead take one object from
20605the stack, which must be an 20599the stack, which must be an
20606@texline @tmath{N\times2} 20600@texline @math{N\times2}
20607@infoline Nx2 20601@infoline Nx2
20608matrix of data values. Once again, variable names can be used in place 20602matrix of data values. Once again, variable names can be used in place
20609of actual vectors and matrices. 20603of actual vectors and matrices.
@@ -20861,7 +20855,7 @@ If any argument to @kbd{V M} is a matrix, the operator is normally mapped
20861across all elements of the matrix. For example, given the matrix 20855across all elements of the matrix. For example, given the matrix
20862@expr{[[1, -2, 3], [-4, 5, -6]]}, @kbd{V M A} takes six absolute values to 20856@expr{[[1, -2, 3], [-4, 5, -6]]}, @kbd{V M A} takes six absolute values to
20863produce another 20857produce another
20864@texline @tmath{3\times2} 20858@texline @math{3\times2}
20865@infoline 3x2 20859@infoline 3x2
20866matrix, @expr{[[1, 2, 3], [4, 5, 6]]}. 20860matrix, @expr{[[1, 2, 3], [4, 5, 6]]}.
20867 20861
@@ -21272,11 +21266,11 @@ for anything else'') prefix.
21272using regular Emacs editing commands. 21266using regular Emacs editing commands.
21273 21267
21274When doing algebraic work, you may find several of the Calculator's 21268When doing algebraic work, you may find several of the Calculator's
21275modes to be helpful, including algebraic-simplification mode (@kbd{m A}) 21269modes to be helpful, including Algebraic Simplification mode (@kbd{m A})
21276or no-simplification mode (@kbd{m O}), 21270or No-Simplification mode (@kbd{m O}),
21277algebraic-entry mode (@kbd{m a}), fraction mode (@kbd{m f}), and 21271Algebraic entry mode (@kbd{m a}), Fraction mode (@kbd{m f}), and
21278symbolic mode (@kbd{m s}). @xref{Mode Settings}, for discussions 21272Symbolic mode (@kbd{m s}). @xref{Mode Settings}, for discussions
21279of these modes. You may also wish to select ``big'' display mode (@kbd{d B}). 21273of these modes. You may also wish to select Big display mode (@kbd{d B}).
21280@xref{Normal Language Modes}. 21274@xref{Normal Language Modes}.
21281 21275
21282@menu 21276@menu
@@ -21330,7 +21324,7 @@ sub-formula, and press @w{@kbd{j s}} (@code{calc-select-here}). Calc will
21330highlight the smallest portion of the formula that contains that 21324highlight the smallest portion of the formula that contains that
21331character. By default the sub-formula is highlighted by blanking out 21325character. By default the sub-formula is highlighted by blanking out
21332all of the rest of the formula with dots. Selection works in any 21326all of the rest of the formula with dots. Selection works in any
21333display mode but is perhaps easiest in ``big'' (@kbd{d B}) mode. 21327display mode but is perhaps easiest in Big mode (@kbd{d B}).
21334Suppose you enter the following formula: 21328Suppose you enter the following formula:
21335 21329
21336@smallexample 21330@smallexample
@@ -21360,7 +21354,7 @@ to
21360Every character not part of the sub-formula @samp{b} has been changed 21354Every character not part of the sub-formula @samp{b} has been changed
21361to a dot. The @samp{*} next to the line number is to remind you that 21355to a dot. The @samp{*} next to the line number is to remind you that
21362the formula has a portion of it selected. (In this case, it's very 21356the formula has a portion of it selected. (In this case, it's very
21363obvious, but it might not always be. If Embedded Mode is enabled, 21357obvious, but it might not always be. If Embedded mode is enabled,
21364the word @samp{Sel} also appears in the mode line because the stack 21358the word @samp{Sel} also appears in the mode line because the stack
21365may not be visible. @pxref{Embedded Mode}.) 21359may not be visible. @pxref{Embedded Mode}.)
21366 21360
@@ -22010,17 +22004,17 @@ but which also substitutes stored values for variables in the formula.
22010Use @kbd{a v} if you want the variables to ignore their stored values. 22004Use @kbd{a v} if you want the variables to ignore their stored values.
22011 22005
22012If you give a numeric prefix argument of 2 to @kbd{a v}, it simplifies 22006If you give a numeric prefix argument of 2 to @kbd{a v}, it simplifies
22013as if in algebraic simplification mode. This is equivalent to typing 22007as if in Algebraic Simplification mode. This is equivalent to typing
22014@kbd{a s}; @pxref{Simplifying Formulas}. If you give a numeric prefix 22008@kbd{a s}; @pxref{Simplifying Formulas}. If you give a numeric prefix
22015of 3 or more, it uses extended simplification mode (@kbd{a e}). 22009of 3 or more, it uses Extended Simplification mode (@kbd{a e}).
22016 22010
22017If you give a negative prefix argument @i{-1}, @i{-2}, or @i{-3}, 22011If you give a negative prefix argument @mathit{-1}, @mathit{-2}, or @mathit{-3},
22018it simplifies in the corresponding mode but only works on the top-level 22012it simplifies in the corresponding mode but only works on the top-level
22019function call of the formula. For example, @samp{(2 + 3) * (2 + 3)} will 22013function call of the formula. For example, @samp{(2 + 3) * (2 + 3)} will
22020simplify to @samp{(2 + 3)^2}, without simplifying the sub-formulas 22014simplify to @samp{(2 + 3)^2}, without simplifying the sub-formulas
22021@samp{2 + 3}. As another example, typing @kbd{V R +} to sum the vector 22015@samp{2 + 3}. As another example, typing @kbd{V R +} to sum the vector
22022@samp{[1, 2, 3, 4]} produces the formula @samp{reduce(add, [1, 2, 3, 4])} 22016@samp{[1, 2, 3, 4]} produces the formula @samp{reduce(add, [1, 2, 3, 4])}
22023in no-simplify mode. Using @kbd{a v} will evaluate this all the way to 22017in No-Simplify mode. Using @kbd{a v} will evaluate this all the way to
2202410; using @kbd{C-u - a v} will evaluate it only to @samp{1 + 2 + 3 + 4}. 2201810; using @kbd{C-u - a v} will evaluate it only to @samp{1 + 2 + 3 + 4}.
22025(@xref{Reducing and Mapping}.) 22019(@xref{Reducing and Mapping}.)
22026 22020
@@ -22028,7 +22022,7 @@ in no-simplify mode. Using @kbd{a v} will evaluate this all the way to
22028@tindex evalvn 22022@tindex evalvn
22029The @kbd{=} command corresponds to the @code{evalv} function, and 22023The @kbd{=} command corresponds to the @code{evalv} function, and
22030the related @kbd{N} command, which is like @kbd{=} but temporarily 22024the related @kbd{N} command, which is like @kbd{=} but temporarily
22031disables symbolic (@kbd{m s}) mode during the evaluation, corresponds 22025disables Symbolic mode (@kbd{m s}) during the evaluation, corresponds
22032to the @code{evalvn} function. (These commands interpret their prefix 22026to the @code{evalvn} function. (These commands interpret their prefix
22033arguments differently than @kbd{a v}; @kbd{=} treats the prefix as 22027arguments differently than @kbd{a v}; @kbd{=} treats the prefix as
22034the number of stack elements to evaluate at once, and @kbd{N} treats 22028the number of stack elements to evaluate at once, and @kbd{N} treats
@@ -22203,7 +22197,7 @@ is evaluated to @expr{3}. Evaluation does not occur if the arguments
22203to a function are somehow of the wrong type @expr{@t{tan}([2,3,4])}), 22197to a function are somehow of the wrong type @expr{@t{tan}([2,3,4])}),
22204range (@expr{@t{tan}(90)}), or number (@expr{@t{tan}(3,5)}), 22198range (@expr{@t{tan}(90)}), or number (@expr{@t{tan}(3,5)}),
22205or if the function name is not recognized (@expr{@t{f}(5)}), or if 22199or if the function name is not recognized (@expr{@t{f}(5)}), or if
22206``symbolic'' mode (@pxref{Symbolic Mode}) prevents evaluation 22200Symbolic mode (@pxref{Symbolic Mode}) prevents evaluation
22207(@expr{@t{sqrt}(2)}). 22201(@expr{@t{sqrt}(2)}).
22208 22202
22209Calc simplifies (evaluates) the arguments to a function before it 22203Calc simplifies (evaluates) the arguments to a function before it
@@ -22286,7 +22280,7 @@ simplifications.)
22286 22280
22287The distributive law is used to simplify sums in some cases: 22281The distributive law is used to simplify sums in some cases:
22288@expr{a x + b x} to @expr{(a + b) x}, where @expr{a} represents 22282@expr{a x + b x} to @expr{(a + b) x}, where @expr{a} represents
22289a number or an implicit 1 or @i{-1} (as in @expr{x} or @expr{-x}) 22283a number or an implicit 1 or @mathit{-1} (as in @expr{x} or @expr{-x})
22290and similarly for @expr{b}. Use the @kbd{a c}, @w{@kbd{a f}}, or 22284and similarly for @expr{b}. Use the @kbd{a c}, @w{@kbd{a f}}, or
22291@kbd{j M} commands to merge sums with non-numeric coefficients 22285@kbd{j M} commands to merge sums with non-numeric coefficients
22292using the distributive law. 22286using the distributive law.
@@ -22311,7 +22305,7 @@ to @expr{-a}.
22311The products @expr{1 a} and @expr{a 1} are simplified to @expr{a}; 22305The products @expr{1 a} and @expr{a 1} are simplified to @expr{a};
22312@expr{(-1) a} and @expr{a (-1)} are simplified to @expr{-a}; 22306@expr{(-1) a} and @expr{a (-1)} are simplified to @expr{-a};
22313@expr{0 a} and @expr{a 0} are simplified to @expr{0}, except that 22307@expr{0 a} and @expr{a 0} are simplified to @expr{0}, except that
22314in matrix mode where @expr{a} is not provably scalar the result 22308in Matrix mode where @expr{a} is not provably scalar the result
22315is the generic zero matrix @samp{idn(0)}, and that if @expr{a} is 22309is the generic zero matrix @samp{idn(0)}, and that if @expr{a} is
22316infinite the result is @samp{nan}. 22310infinite the result is @samp{nan}.
22317 22311
@@ -22330,25 +22324,25 @@ rewritten to @expr{a (c - b)}.
22330 22324
22331The distributive law of products and powers is used for adjacent 22325The distributive law of products and powers is used for adjacent
22332terms of the product: @expr{x^a x^b} goes to 22326terms of the product: @expr{x^a x^b} goes to
22333@texline @tmath{x^{a+b}} 22327@texline @math{x^{a+b}}
22334@infoline @expr{x^(a+b)} 22328@infoline @expr{x^(a+b)}
22335where @expr{a} is a number, or an implicit 1 (as in @expr{x}), 22329where @expr{a} is a number, or an implicit 1 (as in @expr{x}),
22336or the implicit one-half of @expr{@t{sqrt}(x)}, and similarly for 22330or the implicit one-half of @expr{@t{sqrt}(x)}, and similarly for
22337@expr{b}. The result is written using @samp{sqrt} or @samp{1/sqrt} 22331@expr{b}. The result is written using @samp{sqrt} or @samp{1/sqrt}
22338if the sum of the powers is @expr{1/2} or @expr{-1/2}, respectively. 22332if the sum of the powers is @expr{1/2} or @expr{-1/2}, respectively.
22339If the sum of the powers is zero, the product is simplified to 22333If the sum of the powers is zero, the product is simplified to
22340@expr{1} or to @samp{idn(1)} if matrix mode is enabled. 22334@expr{1} or to @samp{idn(1)} if Matrix mode is enabled.
22341 22335
22342The product of a negative power times anything but another negative 22336The product of a negative power times anything but another negative
22343power is changed to use division: 22337power is changed to use division:
22344@texline @tmath{x^{-2} y} 22338@texline @math{x^{-2} y}
22345@infoline @expr{x^(-2) y} 22339@infoline @expr{x^(-2) y}
22346goes to @expr{y / x^2} unless matrix mode is 22340goes to @expr{y / x^2} unless Matrix mode is
22347in effect and neither @expr{x} nor @expr{y} are scalar (in which 22341in effect and neither @expr{x} nor @expr{y} are scalar (in which
22348case it is considered unsafe to rearrange the order of the terms). 22342case it is considered unsafe to rearrange the order of the terms).
22349 22343
22350Finally, @expr{a (b/c)} is rewritten to @expr{(a b)/c}, and also 22344Finally, @expr{a (b/c)} is rewritten to @expr{(a b)/c}, and also
22351@expr{(a/b) c} is changed to @expr{(a c)/b} unless in matrix mode. 22345@expr{(a/b) c} is changed to @expr{(a c)/b} unless in Matrix mode.
22352 22346
22353@tex 22347@tex
22354\bigskip 22348\bigskip
@@ -22365,17 +22359,17 @@ infinite quantity, as directed by the current infinite mode.
22365@xref{Infinite Mode}. 22359@xref{Infinite Mode}.
22366 22360
22367The expression 22361The expression
22368@texline @tmath{a / b^{-c}} 22362@texline @math{a / b^{-c}}
22369@infoline @expr{a / b^(-c)} 22363@infoline @expr{a / b^(-c)}
22370is changed to @expr{a b^c}, where @expr{-c} is any negative-looking 22364is changed to @expr{a b^c}, where @expr{-c} is any negative-looking
22371power. Also, @expr{1 / b^c} is changed to 22365power. Also, @expr{1 / b^c} is changed to
22372@texline @tmath{b^{-c}} 22366@texline @math{b^{-c}}
22373@infoline @expr{b^(-c)} 22367@infoline @expr{b^(-c)}
22374for any power @expr{c}. 22368for any power @expr{c}.
22375 22369
22376Also, @expr{(-a) / b} and @expr{a / (-b)} go to @expr{-(a/b)}; 22370Also, @expr{(-a) / b} and @expr{a / (-b)} go to @expr{-(a/b)};
22377@expr{(a/b) / c} goes to @expr{a / (b c)}; and @expr{a / (b/c)} 22371@expr{(a/b) / c} goes to @expr{a / (b c)}; and @expr{a / (b/c)}
22378goes to @expr{(a c) / b} unless matrix mode prevents this 22372goes to @expr{(a c) / b} unless Matrix mode prevents this
22379rearrangement. Similarly, @expr{a / (b:c)} is simplified to 22373rearrangement. Similarly, @expr{a / (b:c)} is simplified to
22380@expr{(c:b) a} for any fraction @expr{b:c}. 22374@expr{(c:b) a} for any fraction @expr{b:c}.
22381 22375
@@ -22399,7 +22393,7 @@ to @expr{a / (c - b)}, and @expr{(a - b) / (-c)} to @expr{(b - a) / c}.
22399@end tex 22393@end tex
22400 22394
22401The formula @expr{x^0} is simplified to @expr{1}, or to @samp{idn(1)} 22395The formula @expr{x^0} is simplified to @expr{1}, or to @samp{idn(1)}
22402in matrix mode. The formula @expr{0^x} is simplified to @expr{0} 22396in Matrix mode. The formula @expr{0^x} is simplified to @expr{0}
22403unless @expr{x} is a negative number or complex number, in which 22397unless @expr{x} is a negative number or complex number, in which
22404case the result is an infinity or an unsimplified formula according 22398case the result is an infinity or an unsimplified formula according
22405to the current infinite mode. Note that @expr{0^0} is an 22399to the current infinite mode. Note that @expr{0^0} is an
@@ -22410,22 +22404,22 @@ Powers of products or quotients @expr{(a b)^c}, @expr{(a/b)^c}
22410are distributed to @expr{a^c b^c}, @expr{a^c / b^c} only if @expr{c} 22404are distributed to @expr{a^c b^c}, @expr{a^c / b^c} only if @expr{c}
22411is an integer, or if either @expr{a} or @expr{b} are nonnegative 22405is an integer, or if either @expr{a} or @expr{b} are nonnegative
22412real numbers. Powers of powers @expr{(a^b)^c} are simplified to 22406real numbers. Powers of powers @expr{(a^b)^c} are simplified to
22413@texline @tmath{a^{b c}} 22407@texline @math{a^{b c}}
22414@infoline @expr{a^(b c)} 22408@infoline @expr{a^(b c)}
22415only when @expr{c} is an integer and @expr{b c} also 22409only when @expr{c} is an integer and @expr{b c} also
22416evaluates to an integer. Without these restrictions these simplifications 22410evaluates to an integer. Without these restrictions these simplifications
22417would not be safe because of problems with principal values. 22411would not be safe because of problems with principal values.
22418(In other words, 22412(In other words,
22419@texline @tmath{((-3)^{1/2})^2} 22413@texline @math{((-3)^{1/2})^2}
22420@infoline @expr{((-3)^1:2)^2} 22414@infoline @expr{((-3)^1:2)^2}
22421is safe to simplify, but 22415is safe to simplify, but
22422@texline @tmath{((-3)^2)^{1/2}} 22416@texline @math{((-3)^2)^{1/2}}
22423@infoline @expr{((-3)^2)^1:2} 22417@infoline @expr{((-3)^2)^1:2}
22424is not.) @xref{Declarations}, for ways to inform Calc that your 22418is not.) @xref{Declarations}, for ways to inform Calc that your
22425variables satisfy these requirements. 22419variables satisfy these requirements.
22426 22420
22427As a special case of this rule, @expr{@t{sqrt}(x)^n} is simplified to 22421As a special case of this rule, @expr{@t{sqrt}(x)^n} is simplified to
22428@texline @tmath{x^{n/2}} 22422@texline @math{x^{n/2}}
22429@infoline @expr{x^(n/2)} 22423@infoline @expr{x^(n/2)}
22430only for even integers @expr{n}. 22424only for even integers @expr{n}.
22431 22425
@@ -22438,15 +22432,15 @@ even integer, or to @expr{-(a^b)} if @expr{b} is an odd integer,
22438for any negative-looking expression @expr{-a}. 22432for any negative-looking expression @expr{-a}.
22439 22433
22440Square roots @expr{@t{sqrt}(x)} generally act like one-half powers 22434Square roots @expr{@t{sqrt}(x)} generally act like one-half powers
22441@texline @tmath{x^{1:2}} 22435@texline @math{x^{1:2}}
22442@infoline @expr{x^1:2} 22436@infoline @expr{x^1:2}
22443for the purposes of the above-listed simplifications. 22437for the purposes of the above-listed simplifications.
22444 22438
22445Also, note that 22439Also, note that
22446@texline @tmath{1 / x^{1:2}} 22440@texline @math{1 / x^{1:2}}
22447@infoline @expr{1 / x^1:2} 22441@infoline @expr{1 / x^1:2}
22448is changed to 22442is changed to
22449@texline @tmath{x^{-1:2}}, 22443@texline @math{x^{-1:2}},
22450@infoline @expr{x^(-1:2)}, 22444@infoline @expr{x^(-1:2)},
22451but @expr{1 / @t{sqrt}(x)} is left alone. 22445but @expr{1 / @t{sqrt}(x)} is left alone.
22452 22446
@@ -22575,7 +22569,7 @@ property that real-valued numbers, interval forms and infinities
22575come first, and are sorted into increasing order. The @kbd{V S} 22569come first, and are sorted into increasing order. The @kbd{V S}
22576command uses the same ordering when sorting a vector. 22570command uses the same ordering when sorting a vector.
22577 22571
22578Sorting of terms of products is inhibited when matrix mode is 22572Sorting of terms of products is inhibited when Matrix mode is
22579turned on; in this case, Calc will never exchange the order of 22573turned on; in this case, Calc will never exchange the order of
22580two terms unless it knows at least one of the terms is a scalar. 22574two terms unless it knows at least one of the terms is a scalar.
22581 22575
@@ -22589,7 +22583,7 @@ Thus @expr{(x + y) (y + x)} will be simplified to @expr{(x + y)^2}.
22589A subtle point is that @expr{(x - y) (y - x)} will @emph{not} 22583A subtle point is that @expr{(x - y) (y - x)} will @emph{not}
22590be simplified to @expr{-(x - y)^2}; Calc does not notice that 22584be simplified to @expr{-(x - y)^2}; Calc does not notice that
22591one term can be written as a constant times the other, even if 22585one term can be written as a constant times the other, even if
22592that constant is @i{-1}. 22586that constant is @mathit{-1}.
22593 22587
22594A fraction times any expression, @expr{(a:b) x}, is changed to 22588A fraction times any expression, @expr{(a:b) x}, is changed to
22595a quotient involving integers: @expr{a x / b}. This is not 22589a quotient involving integers: @expr{a x / b}. This is not
@@ -22632,7 +22626,7 @@ Square roots of integer or rational arguments are simplified in
22632several ways. (Note that these will be left unevaluated only in 22626several ways. (Note that these will be left unevaluated only in
22633Symbolic mode.) First, square integer or rational factors are 22627Symbolic mode.) First, square integer or rational factors are
22634pulled out so that @expr{@t{sqrt}(8)} is rewritten as 22628pulled out so that @expr{@t{sqrt}(8)} is rewritten as
22635@texline @tmath{$2\,\t{sqrt}(2)$}. 22629@texline @math{2\,\t{sqrt}(2)}.
22636@infoline @expr{2 sqrt(2)}. 22630@infoline @expr{2 sqrt(2)}.
22637Conceptually speaking this implies factoring the argument into primes 22631Conceptually speaking this implies factoring the argument into primes
22638and moving pairs of primes out of the square root, but for reasons of 22632and moving pairs of primes out of the square root, but for reasons of
@@ -22694,23 +22688,23 @@ functions are known, except for negative arguments of @code{arcsin},
22694@code{arctan}, @code{arcsinh}, and @code{arctanh}. Note that 22688@code{arctan}, @code{arcsinh}, and @code{arctanh}. Note that
22695@expr{@t{arcsin}(@t{sin}(x))} can @emph{not} safely change to 22689@expr{@t{arcsin}(@t{sin}(x))} can @emph{not} safely change to
22696@expr{x}, since this only correct within an integer multiple of 22690@expr{x}, since this only correct within an integer multiple of
22697@texline @tmath{2 \pi} 22691@texline @math{2 \pi}
22698@infoline @expr{2 pi} 22692@infoline @expr{2 pi}
22699radians or 360 degrees. However, @expr{@t{arcsinh}(@t{sinh}(x))} is 22693radians or 360 degrees. However, @expr{@t{arcsinh}(@t{sinh}(x))} is
22700simplified to @expr{x} if @expr{x} is known to be real. 22694simplified to @expr{x} if @expr{x} is known to be real.
22701 22695
22702Several simplifications that apply to logarithms and exponentials 22696Several simplifications that apply to logarithms and exponentials
22703are that @expr{@t{exp}(@t{ln}(x))}, 22697are that @expr{@t{exp}(@t{ln}(x))},
22704@texline @t{e}@tmath{^{\ln(x)}}, 22698@texline @t{e}@math{^{\ln(x)}},
22705@infoline @expr{e^@t{ln}(x)}, 22699@infoline @expr{e^@t{ln}(x)},
22706and 22700and
22707@texline @tmath{10^{{\rm log10}(x)}} 22701@texline @math{10^{{\rm log10}(x)}}
22708@infoline @expr{10^@t{log10}(x)} 22702@infoline @expr{10^@t{log10}(x)}
22709all reduce to @expr{x}. Also, @expr{@t{ln}(@t{exp}(x))}, etc., can 22703all reduce to @expr{x}. Also, @expr{@t{ln}(@t{exp}(x))}, etc., can
22710reduce to @expr{x} if @expr{x} is provably real. The form 22704reduce to @expr{x} if @expr{x} is provably real. The form
22711@expr{@t{exp}(x)^y} is simplified to @expr{@t{exp}(x y)}. If @expr{x} 22705@expr{@t{exp}(x)^y} is simplified to @expr{@t{exp}(x y)}. If @expr{x}
22712is a suitable multiple of 22706is a suitable multiple of
22713@texline @tmath{\pi i} 22707@texline @math{\pi i}
22714@infoline @expr{pi i} 22708@infoline @expr{pi i}
22715(as described above for the trigonometric functions), then 22709(as described above for the trigonometric functions), then
22716@expr{@t{exp}(x)} or @expr{e^x} will be expanded. Finally, 22710@expr{@t{exp}(x)} or @expr{e^x} will be expanded. Finally,
@@ -22795,18 +22789,18 @@ are folded down to the 360-degree range that the inverse trigonometric
22795functions always produce. 22789functions always produce.
22796 22790
22797Powers of powers @expr{(x^a)^b} are simplified to 22791Powers of powers @expr{(x^a)^b} are simplified to
22798@texline @tmath{x^{a b}} 22792@texline @math{x^{a b}}
22799@infoline @expr{x^(a b)} 22793@infoline @expr{x^(a b)}
22800for all @expr{a} and @expr{b}. These results will be valid only 22794for all @expr{a} and @expr{b}. These results will be valid only
22801in a restricted range of @expr{x}; for example, in 22795in a restricted range of @expr{x}; for example, in
22802@texline @tmath{(x^2)^{1:2}} 22796@texline @math{(x^2)^{1:2}}
22803@infoline @expr{(x^2)^1:2} 22797@infoline @expr{(x^2)^1:2}
22804the powers cancel to get @expr{x}, which is valid for positive values 22798the powers cancel to get @expr{x}, which is valid for positive values
22805of @expr{x} but not for negative or complex values. 22799of @expr{x} but not for negative or complex values.
22806 22800
22807Similarly, @expr{@t{sqrt}(x^a)} and @expr{@t{sqrt}(x)^a} are both 22801Similarly, @expr{@t{sqrt}(x^a)} and @expr{@t{sqrt}(x)^a} are both
22808simplified (possibly unsafely) to 22802simplified (possibly unsafely) to
22809@texline @tmath{x^{a/2}}. 22803@texline @math{x^{a/2}}.
22810@infoline @expr{x^(a/2)}. 22804@infoline @expr{x^(a/2)}.
22811 22805
22812Forms like @expr{@t{sqrt}(1 - sin(x)^2)} are simplified to, e.g., 22806Forms like @expr{@t{sqrt}(1 - sin(x)^2)} are simplified to, e.g.,
@@ -22882,7 +22876,7 @@ number for an answer, then the quotient simplifies to that number.
22882For powers and square roots, the ``unsafe'' simplifications 22876For powers and square roots, the ``unsafe'' simplifications
22883@expr{(a b)^c} to @expr{a^c b^c}, @expr{(a/b)^c} to @expr{a^c / b^c}, 22877@expr{(a b)^c} to @expr{a^c b^c}, @expr{(a/b)^c} to @expr{a^c / b^c},
22884and @expr{(a^b)^c} to 22878and @expr{(a^b)^c} to
22885@texline @tmath{a^{b c}} 22879@texline @math{a^{b c}}
22886@infoline @expr{a^(b c)} 22880@infoline @expr{a^(b c)}
22887are done if the powers are real numbers. (These are safe in the context 22881are done if the powers are real numbers. (These are safe in the context
22888of units because all numbers involved can reasonably be assumed to be 22882of units because all numbers involved can reasonably be assumed to be
@@ -22897,10 +22891,10 @@ is simplified by noting that @expr{1.5 = 3:2}, that @samp{acre}
22897is defined in terms of @samp{m^2}, and that the 2 in the power of 22891is defined in terms of @samp{m^2}, and that the 2 in the power of
22898@code{m} is a multiple of 2 in @expr{3:2}. Thus, @code{acre^1.5} is 22892@code{m} is a multiple of 2 in @expr{3:2}. Thus, @code{acre^1.5} is
22899replaced by approximately 22893replaced by approximately
22900@texline @tmath{(4046 m^2)^{1.5}} 22894@texline @math{(4046 m^2)^{1.5}}
22901@infoline @expr{(4046 m^2)^1.5}, 22895@infoline @expr{(4046 m^2)^1.5},
22902which is then changed to 22896which is then changed to
22903@texline @tmath{4046^{1.5} \, (m^2)^{1.5}}, 22897@texline @math{4046^{1.5} \, (m^2)^{1.5}},
22904@infoline @expr{4046^1.5 (m^2)^1.5}, 22898@infoline @expr{4046^1.5 (m^2)^1.5},
22905then to @expr{257440 m^3}. 22899then to @expr{257440 m^3}.
22906 22900
@@ -23183,14 +23177,14 @@ With a numeric prefix argument @var{n}, this command computes the
23183@var{n}th derivative. 23177@var{n}th derivative.
23184 23178
23185When working with trigonometric functions, it is best to switch to 23179When working with trigonometric functions, it is best to switch to
23186radians mode first (with @w{@kbd{m r}}). The derivative of @samp{sin(x)} 23180Radians mode first (with @w{@kbd{m r}}). The derivative of @samp{sin(x)}
23187in degrees is @samp{(pi/180) cos(x)}, probably not the expected 23181in degrees is @samp{(pi/180) cos(x)}, probably not the expected
23188answer! 23182answer!
23189 23183
23190If you use the @code{deriv} function directly in an algebraic formula, 23184If you use the @code{deriv} function directly in an algebraic formula,
23191you can write @samp{deriv(f,x,x0)} which represents the derivative 23185you can write @samp{deriv(f,x,x0)} which represents the derivative
23192of @expr{f} with respect to @expr{x}, evaluated at the point 23186of @expr{f} with respect to @expr{x}, evaluated at the point
23193@texline @tmath{x=x_0}. 23187@texline @math{x=x_0}.
23194@infoline @expr{x=x0}. 23188@infoline @expr{x=x0}.
23195 23189
23196If the formula being differentiated contains functions which Calc does 23190If the formula being differentiated contains functions which Calc does
@@ -23230,7 +23224,7 @@ all integrable functions, but it is able to integrate several large
23230classes of formulas. In particular, any polynomial or rational function 23224classes of formulas. In particular, any polynomial or rational function
23231(a polynomial divided by a polynomial) is acceptable. (Rational functions 23225(a polynomial divided by a polynomial) is acceptable. (Rational functions
23232don't have to be in explicit quotient form, however; 23226don't have to be in explicit quotient form, however;
23233@texline @tmath{x/(1+x^{-2})} 23227@texline @math{x/(1+x^{-2})}
23234@infoline @expr{x/(1+x^-2)} 23228@infoline @expr{x/(1+x^-2)}
23235is not strictly a quotient of polynomials, but it is equivalent to 23229is not strictly a quotient of polynomials, but it is equivalent to
23236@expr{x^3/(x^2+1)}, which is.) Also, square roots of terms involving 23230@expr{x^3/(x^2+1)}, which is.) Also, square roots of terms involving
@@ -23256,7 +23250,7 @@ integral $\int_a^b f(x) \, dx$.
23256Please note that the current implementation of Calc's integrator sometimes 23250Please note that the current implementation of Calc's integrator sometimes
23257produces results that are significantly more complex than they need to 23251produces results that are significantly more complex than they need to
23258be. For example, the integral Calc finds for 23252be. For example, the integral Calc finds for
23259@texline @tmath{1/(x+\sqrt{x^2+1})} 23253@texline @math{1/(x+\sqrt{x^2+1})}
23260@infoline @expr{1/(x+sqrt(x^2+1))} 23254@infoline @expr{1/(x+sqrt(x^2+1))}
23261is several times more complicated than the answer Mathematica 23255is several times more complicated than the answer Mathematica
23262returns for the same input, although the two forms are numerically 23256returns for the same input, although the two forms are numerically
@@ -23264,17 +23258,17 @@ equivalent. Also, any indefinite integral should be considered to have
23264an arbitrary constant of integration added to it, although Calc does not 23258an arbitrary constant of integration added to it, although Calc does not
23265write an explicit constant of integration in its result. For example, 23259write an explicit constant of integration in its result. For example,
23266Calc's solution for 23260Calc's solution for
23267@texline @tmath{1/(1+\tan x)} 23261@texline @math{1/(1+\tan x)}
23268@infoline @expr{1/(1+tan(x))} 23262@infoline @expr{1/(1+tan(x))}
23269differs from the solution given in the @emph{CRC Math Tables} by a 23263differs from the solution given in the @emph{CRC Math Tables} by a
23270constant factor of 23264constant factor of
23271@texline @tmath{\pi i / 2} 23265@texline @math{\pi i / 2}
23272@infoline @expr{pi i / 2}, 23266@infoline @expr{pi i / 2},
23273due to a different choice of constant of integration. 23267due to a different choice of constant of integration.
23274 23268
23275The Calculator remembers all the integrals it has done. If conditions 23269The Calculator remembers all the integrals it has done. If conditions
23276change in a way that would invalidate the old integrals, say, a switch 23270change in a way that would invalidate the old integrals, say, a switch
23277from degrees to radians mode, then they will be thrown out. If you 23271from Degrees to Radians mode, then they will be thrown out. If you
23278suspect this is not happening when it should, use the 23272suspect this is not happening when it should, use the
23279@code{calc-flush-caches} command; @pxref{Caches}. 23273@code{calc-flush-caches} command; @pxref{Caches}.
23280 23274
@@ -23328,7 +23322,7 @@ in your @code{IntegRules}.
23328As a more serious example, the expression @samp{exp(x)/x} cannot be 23322As a more serious example, the expression @samp{exp(x)/x} cannot be
23329integrated in terms of the standard functions, so the ``exponential 23323integrated in terms of the standard functions, so the ``exponential
23330integral'' function 23324integral'' function
23331@texline @tmath{{\rm Ei}(x)} 23325@texline @math{{\rm Ei}(x)}
23332@infoline @expr{Ei(x)} 23326@infoline @expr{Ei(x)}
23333was invented to describe it. 23327was invented to describe it.
23334We can get Calc to do this integral in terms of a made-up @code{Ei} 23328We can get Calc to do this integral in terms of a made-up @code{Ei}
@@ -23501,16 +23495,16 @@ form @expr{X = 0}.
23501This command also works for inequalities, as in @expr{y < 3x + 6}. 23495This command also works for inequalities, as in @expr{y < 3x + 6}.
23502Some inequalities cannot be solved where the analogous equation could 23496Some inequalities cannot be solved where the analogous equation could
23503be; for example, solving 23497be; for example, solving
23504@texline @tmath{a < b \, c} 23498@texline @math{a < b \, c}
23505@infoline @expr{a < b c} 23499@infoline @expr{a < b c}
23506for @expr{b} is impossible 23500for @expr{b} is impossible
23507without knowing the sign of @expr{c}. In this case, @kbd{a S} will 23501without knowing the sign of @expr{c}. In this case, @kbd{a S} will
23508produce the result 23502produce the result
23509@texline @tmath{b \mathbin{\hbox{\code{!=}}} a/c} 23503@texline @math{b \mathbin{\hbox{\code{!=}}} a/c}
23510@infoline @expr{b != a/c} 23504@infoline @expr{b != a/c}
23511(using the not-equal-to operator) to signify that the direction of the 23505(using the not-equal-to operator) to signify that the direction of the
23512inequality is now unknown. The inequality 23506inequality is now unknown. The inequality
23513@texline @tmath{a \le b \, c} 23507@texline @math{a \le b \, c}
23514@infoline @expr{a <= b c} 23508@infoline @expr{a <= b c}
23515is not even partially solved. @xref{Declarations}, for a way to tell 23509is not even partially solved. @xref{Declarations}, for a way to tell
23516Calc that the signs of the variables in a formula are in fact known. 23510Calc that the signs of the variables in a formula are in fact known.
@@ -23537,7 +23531,7 @@ Some equations have more than one solution. The Hyperbolic flag
23537general family of solutions. It will invent variables @code{n1}, 23531general family of solutions. It will invent variables @code{n1},
23538@code{n2}, @dots{}, which represent independent arbitrary integers, and 23532@code{n2}, @dots{}, which represent independent arbitrary integers, and
23539@code{s1}, @code{s2}, @dots{}, which represent independent arbitrary 23533@code{s1}, @code{s2}, @dots{}, which represent independent arbitrary
23540signs (either @i{+1} or @i{-1}). If you don't use the Hyperbolic 23534signs (either @mathit{+1} or @mathit{-1}). If you don't use the Hyperbolic
23541flag, Calc will use zero in place of all arbitrary integers, and plus 23535flag, Calc will use zero in place of all arbitrary integers, and plus
23542one in place of all arbitrary signs. Note that variables like @code{n1} 23536one in place of all arbitrary signs. Note that variables like @code{n1}
23543and @code{s1} are not given any special interpretation in Calc except by 23537and @code{s1} are not given any special interpretation in Calc except by
@@ -23633,10 +23627,10 @@ which can be solved for @expr{x^3} using the quadratic equation, and then
23633for @expr{x} by taking cube roots. But in many cases, like 23627for @expr{x} by taking cube roots. But in many cases, like
23634@expr{x^6 + x + 1}, Calc does not know how to rewrite the polynomial 23628@expr{x^6 + x + 1}, Calc does not know how to rewrite the polynomial
23635into a form it can solve. The @kbd{a P} command can still deliver a 23629into a form it can solve. The @kbd{a P} command can still deliver a
23636list of numerical roots, however, provided that symbolic mode (@kbd{m s}) 23630list of numerical roots, however, provided that Symbolic mode (@kbd{m s})
23637is not turned on. (If you work with symbolic mode on, recall that the 23631is not turned on. (If you work with Symbolic mode on, recall that the
23638@kbd{N} (@code{calc-eval-num}) key is a handy way to reevaluate the 23632@kbd{N} (@code{calc-eval-num}) key is a handy way to reevaluate the
23639formula on the stack with symbolic mode temporarily off.) Naturally, 23633formula on the stack with Symbolic mode temporarily off.) Naturally,
23640@kbd{a P} can only provide numerical roots if the polynomial coefficients 23634@kbd{a P} can only provide numerical roots if the polynomial coefficients
23641are all numbers (real or complex). 23635are all numbers (real or complex).
23642 23636
@@ -23970,11 +23964,11 @@ with the minimum value itself.
23970 23964
23971Note that this command looks for a @emph{local} minimum. Many functions 23965Note that this command looks for a @emph{local} minimum. Many functions
23972have more than one minimum; some, like 23966have more than one minimum; some, like
23973@texline @tmath{x \sin x}, 23967@texline @math{x \sin x},
23974@infoline @expr{x sin(x)}, 23968@infoline @expr{x sin(x)},
23975have infinitely many. In fact, there is no easy way to define the 23969have infinitely many. In fact, there is no easy way to define the
23976``global'' minimum of 23970``global'' minimum of
23977@texline @tmath{x \sin x} 23971@texline @math{x \sin x}
23978@infoline @expr{x sin(x)} 23972@infoline @expr{x sin(x)}
23979but Calc can still locate any particular local minimum 23973but Calc can still locate any particular local minimum
23980for you. Calc basically goes downhill from the initial guess until it 23974for you. Calc basically goes downhill from the initial guess until it
@@ -24097,7 +24091,7 @@ the @dfn{parameters} of the model.
24097The @kbd{a F} command takes the data set to be fitted from the stack. 24091The @kbd{a F} command takes the data set to be fitted from the stack.
24098By default, it expects the data in the form of a matrix. For example, 24092By default, it expects the data in the form of a matrix. For example,
24099for a linear or polynomial fit, this would be a 24093for a linear or polynomial fit, this would be a
24100@texline @tmath{2\times N} 24094@texline @math{2\times N}
24101@infoline 2xN 24095@infoline 2xN
24102matrix where the first row is a list of @expr{x} values and the second 24096matrix where the first row is a list of @expr{x} values and the second
24103row has the corresponding @expr{y} values. For the multilinear fit 24097row has the corresponding @expr{y} values. For the multilinear fit
@@ -24105,10 +24099,10 @@ shown above, the matrix would have four rows (@expr{x_1}, @expr{x_2},
24105@expr{x_3}, and @expr{y}, respectively). 24099@expr{x_3}, and @expr{y}, respectively).
24106 24100
24107If you happen to have an 24101If you happen to have an
24108@texline @tmath{N\times2} 24102@texline @math{N\times2}
24109@infoline Nx2 24103@infoline Nx2
24110matrix instead of a 24104matrix instead of a
24111@texline @tmath{2\times N} 24105@texline @math{2\times N}
24112@infoline 2xN 24106@infoline 2xN
24113matrix, just press @kbd{v t} first to transpose the matrix. 24107matrix, just press @kbd{v t} first to transpose the matrix.
24114 24108
@@ -24206,11 +24200,11 @@ which is clearly zero if @expr{a + b x} exactly fits all data points,
24206and increases as various @expr{a + b x_i} values fail to match the 24200and increases as various @expr{a + b x_i} values fail to match the
24207corresponding @expr{y_i} values. There are several reasons why the 24201corresponding @expr{y_i} values. There are several reasons why the
24208summand is squared, one of them being to ensure that 24202summand is squared, one of them being to ensure that
24209@texline @tmath{\chi^2 \ge 0}. 24203@texline @math{\chi^2 \ge 0}.
24210@infoline @expr{chi^2 >= 0}. 24204@infoline @expr{chi^2 >= 0}.
24211Least-squares fitting simply chooses the values of @expr{a} and @expr{b} 24205Least-squares fitting simply chooses the values of @expr{a} and @expr{b}
24212for which the error 24206for which the error
24213@texline @tmath{\chi^2} 24207@texline @math{\chi^2}
24214@infoline @expr{chi^2} 24208@infoline @expr{chi^2}
24215is as small as possible. 24209is as small as possible.
24216 24210
@@ -24251,9 +24245,9 @@ Note that since the constant and linear terms are enough to fit the
24251data exactly, it's no surprise that Calc chose a tiny contribution 24245data exactly, it's no surprise that Calc chose a tiny contribution
24252for @expr{x^2}. (The fact that it's not exactly zero is due only 24246for @expr{x^2}. (The fact that it's not exactly zero is due only
24253to roundoff error. Since our data are exact integers, we could get 24247to roundoff error. Since our data are exact integers, we could get
24254an exact answer by typing @kbd{m f} first to get fraction mode. 24248an exact answer by typing @kbd{m f} first to get Fraction mode.
24255Then the @expr{x^2} term would vanish altogether. Usually, though, 24249Then the @expr{x^2} term would vanish altogether. Usually, though,
24256the data being fitted will be approximate floats so fraction mode 24250the data being fitted will be approximate floats so Fraction mode
24257won't help.) 24251won't help.)
24258 24252
24259Doing the @kbd{a F 2} fit on the data set with 14 instead of 13 24253Doing the @kbd{a F 2} fit on the data set with 14 instead of 13
@@ -24266,7 +24260,7 @@ line slightly to improve the fit.
24266 24260
24267An important result from the theory of polynomial fitting is that it 24261An important result from the theory of polynomial fitting is that it
24268is always possible to fit @var{n} data points exactly using a polynomial 24262is always possible to fit @var{n} data points exactly using a polynomial
24269of degree @i{@var{n}-1}, sometimes called an @dfn{interpolating polynomial}. 24263of degree @mathit{@var{n}-1}, sometimes called an @dfn{interpolating polynomial}.
24270Using the modified (14) data matrix, a model number of 4 gives 24264Using the modified (14) data matrix, a model number of 4 gives
24271a polynomial that exactly matches all five data points: 24265a polynomial that exactly matches all five data points:
24272 24266
@@ -24278,7 +24272,7 @@ The actual coefficients we get with a precision of 12, like
24278@expr{0.0416666663588}, clearly suffer from loss of precision. 24272@expr{0.0416666663588}, clearly suffer from loss of precision.
24279It is a good idea to increase the working precision to several 24273It is a good idea to increase the working precision to several
24280digits beyond what you need when you do a fitting operation. 24274digits beyond what you need when you do a fitting operation.
24281Or, if your data are exact, use fraction mode to get exact 24275Or, if your data are exact, use Fraction mode to get exact
24282results. 24276results.
24283 24277
24284You can type @kbd{i} instead of a digit at the model prompt to fit 24278You can type @kbd{i} instead of a digit at the model prompt to fit
@@ -24371,10 +24365,10 @@ contain error forms. The data values must either all include errors
24371or all be plain numbers. Error forms can go anywhere but generally 24365or all be plain numbers. Error forms can go anywhere but generally
24372go on the numbers in the last row of the data matrix. If the last 24366go on the numbers in the last row of the data matrix. If the last
24373row contains error forms 24367row contains error forms
24374@texline `@var{y_i}@w{ @t{+/-} }@tmath{\sigma_i}', 24368@texline `@var{y_i}@w{ @t{+/-} }@math{\sigma_i}',
24375@infoline `@var{y_i}@w{ @t{+/-} }@var{sigma_i}', 24369@infoline `@var{y_i}@w{ @t{+/-} }@var{sigma_i}',
24376then the 24370then the
24377@texline @tmath{\chi^2} 24371@texline @math{\chi^2}
24378@infoline @expr{chi^2} 24372@infoline @expr{chi^2}
24379statistic is now, 24373statistic is now,
24380 24374
@@ -24397,7 +24391,7 @@ the fitting operation.
24397If there are error forms on other rows of the data matrix, all the 24391If there are error forms on other rows of the data matrix, all the
24398errors for a given data point are combined; the square root of the 24392errors for a given data point are combined; the square root of the
24399sum of the squares of the errors forms the 24393sum of the squares of the errors forms the
24400@texline @tmath{\sigma_i} 24394@texline @math{\sigma_i}
24401@infoline @expr{sigma_i} 24395@infoline @expr{sigma_i}
24402used for the data point. 24396used for the data point.
24403 24397
@@ -24407,14 +24401,14 @@ probably use @kbd{H a F} so that the output also contains error
24407estimates. 24401estimates.
24408 24402
24409If the input contains error forms but all the 24403If the input contains error forms but all the
24410@texline @tmath{\sigma_i} 24404@texline @math{\sigma_i}
24411@infoline @expr{sigma_i} 24405@infoline @expr{sigma_i}
24412values are the same, it is easy to see that the resulting fitted model 24406values are the same, it is easy to see that the resulting fitted model
24413will be the same as if the input did not have error forms at all 24407will be the same as if the input did not have error forms at all
24414@texline (@tmath{\chi^2} 24408@texline (@math{\chi^2}
24415@infoline (@expr{chi^2} 24409@infoline (@expr{chi^2}
24416is simply scaled uniformly by 24410is simply scaled uniformly by
24417@texline @tmath{1 / \sigma^2}, 24411@texline @math{1 / \sigma^2},
24418@infoline @expr{1 / sigma^2}, 24412@infoline @expr{1 / sigma^2},
24419which doesn't affect where it has a minimum). But there @emph{will} be 24413which doesn't affect where it has a minimum). But there @emph{will} be
24420a difference in the estimated errors of the coefficients reported by 24414a difference in the estimated errors of the coefficients reported by
@@ -24449,20 +24443,20 @@ will have length @expr{M = d+1} with the constant term first.
24449@item 24443@item
24450The covariance matrix @expr{C} computed from the fit. This is 24444The covariance matrix @expr{C} computed from the fit. This is
24451an @var{m}x@var{m} symmetric matrix; the diagonal elements 24445an @var{m}x@var{m} symmetric matrix; the diagonal elements
24452@texline @tmath{C_{jj}} 24446@texline @math{C_{jj}}
24453@infoline @expr{C_j_j} 24447@infoline @expr{C_j_j}
24454are the variances 24448are the variances
24455@texline @tmath{\sigma_j^2} 24449@texline @math{\sigma_j^2}
24456@infoline @expr{sigma_j^2} 24450@infoline @expr{sigma_j^2}
24457of the parameters. The other elements are covariances 24451of the parameters. The other elements are covariances
24458@texline @tmath{\sigma_{ij}^2} 24452@texline @math{\sigma_{ij}^2}
24459@infoline @expr{sigma_i_j^2} 24453@infoline @expr{sigma_i_j^2}
24460that describe the correlation between pairs of parameters. (A related 24454that describe the correlation between pairs of parameters. (A related
24461set of numbers, the @dfn{linear correlation coefficients} 24455set of numbers, the @dfn{linear correlation coefficients}
24462@texline @tmath{r_{ij}}, 24456@texline @math{r_{ij}},
24463@infoline @expr{r_i_j}, 24457@infoline @expr{r_i_j},
24464are defined as 24458are defined as
24465@texline @tmath{\sigma_{ij}^2 / \sigma_i \, \sigma_j}.) 24459@texline @math{\sigma_{ij}^2 / \sigma_i \, \sigma_j}.)
24466@infoline @expr{sigma_i_j^2 / sigma_i sigma_j}.) 24460@infoline @expr{sigma_i_j^2 / sigma_i sigma_j}.)
24467 24461
24468@item 24462@item
@@ -24473,11 +24467,11 @@ polynomial and multilinear fits described so far.
24473 24467
24474@item 24468@item
24475The value of 24469The value of
24476@texline @tmath{\chi^2} 24470@texline @math{\chi^2}
24477@infoline @expr{chi^2} 24471@infoline @expr{chi^2}
24478for the fit, calculated by the formulas shown above. This gives a 24472for the fit, calculated by the formulas shown above. This gives a
24479measure of the quality of the fit; statisticians consider 24473measure of the quality of the fit; statisticians consider
24480@texline @tmath{\chi^2 \approx N - M} 24474@texline @math{\chi^2 \approx N - M}
24481@infoline @expr{chi^2 = N - M} 24475@infoline @expr{chi^2 = N - M}
24482to indicate a moderately good fit (where again @expr{N} is the number of 24476to indicate a moderately good fit (where again @expr{N} is the number of
24483data points and @expr{M} is the number of parameters). 24477data points and @expr{M} is the number of parameters).
@@ -24486,13 +24480,13 @@ data points and @expr{M} is the number of parameters).
24486A measure of goodness of fit expressed as a probability @expr{Q}. 24480A measure of goodness of fit expressed as a probability @expr{Q}.
24487This is computed from the @code{utpc} probability distribution 24481This is computed from the @code{utpc} probability distribution
24488function using 24482function using
24489@texline @tmath{\chi^2} 24483@texline @math{\chi^2}
24490@infoline @expr{chi^2} 24484@infoline @expr{chi^2}
24491with @expr{N - M} degrees of freedom. A 24485with @expr{N - M} degrees of freedom. A
24492value of 0.5 implies a good fit; some texts recommend that often 24486value of 0.5 implies a good fit; some texts recommend that often
24493@expr{Q = 0.1} or even 0.001 can signify an acceptable fit. In 24487@expr{Q = 0.1} or even 0.001 can signify an acceptable fit. In
24494particular, 24488particular,
24495@texline @tmath{\chi^2} 24489@texline @math{\chi^2}
24496@infoline @expr{chi^2} 24490@infoline @expr{chi^2}
24497statistics assume the errors in your inputs 24491statistics assume the errors in your inputs
24498follow a normal (Gaussian) distribution; if they don't, you may 24492follow a normal (Gaussian) distribution; if they don't, you may
@@ -24501,7 +24495,7 @@ have to accept smaller values of @expr{Q}.
24501The @expr{Q} value is computed only if the input included error 24495The @expr{Q} value is computed only if the input included error
24502estimates. Otherwise, Calc will report the symbol @code{nan} 24496estimates. Otherwise, Calc will report the symbol @code{nan}
24503for @expr{Q}. The reason is that in this case the 24497for @expr{Q}. The reason is that in this case the
24504@texline @tmath{\chi^2} 24498@texline @math{\chi^2}
24505@infoline @expr{chi^2} 24499@infoline @expr{chi^2}
24506value has effectively been used to estimate the original errors 24500value has effectively been used to estimate the original errors
24507in the input, and thus there is no redundant information left 24501in the input, and thus there is no redundant information left
@@ -24520,31 +24514,31 @@ Here is a complete list of the standard models recognized by @kbd{a F}:
24520 24514
24521@table @kbd 24515@table @kbd
24522@item 1 24516@item 1
24523Linear or multilinear. @i{a + b x + c y + d z}. 24517Linear or multilinear. @mathit{a + b x + c y + d z}.
24524@item 2-9 24518@item 2-9
24525Polynomials. @i{a + b x + c x^2 + d x^3}. 24519Polynomials. @mathit{a + b x + c x^2 + d x^3}.
24526@item e 24520@item e
24527Exponential. @i{a} @t{exp}@i{(b x)} @t{exp}@i{(c y)}. 24521Exponential. @mathit{a} @t{exp}@mathit{(b x)} @t{exp}@mathit{(c y)}.
24528@item E 24522@item E
24529Base-10 exponential. @i{a} @t{10^}@i{(b x)} @t{10^}@i{(c y)}. 24523Base-10 exponential. @mathit{a} @t{10^}@mathit{(b x)} @t{10^}@mathit{(c y)}.
24530@item x 24524@item x
24531Exponential (alternate notation). @t{exp}@i{(a + b x + c y)}. 24525Exponential (alternate notation). @t{exp}@mathit{(a + b x + c y)}.
24532@item X 24526@item X
24533Base-10 exponential (alternate). @t{10^}@i{(a + b x + c y)}. 24527Base-10 exponential (alternate). @t{10^}@mathit{(a + b x + c y)}.
24534@item l 24528@item l
24535Logarithmic. @i{a + b} @t{ln}@i{(x) + c} @t{ln}@i{(y)}. 24529Logarithmic. @mathit{a + b} @t{ln}@mathit{(x) + c} @t{ln}@mathit{(y)}.
24536@item L 24530@item L
24537Base-10 logarithmic. @i{a + b} @t{log10}@i{(x) + c} @t{log10}@i{(y)}. 24531Base-10 logarithmic. @mathit{a + b} @t{log10}@mathit{(x) + c} @t{log10}@mathit{(y)}.
24538@item ^ 24532@item ^
24539General exponential. @i{a b^x c^y}. 24533General exponential. @mathit{a b^x c^y}.
24540@item p 24534@item p
24541Power law. @i{a x^b y^c}. 24535Power law. @mathit{a x^b y^c}.
24542@item q 24536@item q
24543Quadratic. @i{a + b (x-c)^2 + d (x-e)^2}. 24537Quadratic. @mathit{a + b (x-c)^2 + d (x-e)^2}.
24544@item g 24538@item g
24545Gaussian. 24539Gaussian.
24546@texline @tmath{{a \over b \sqrt{2 \pi}} \exp\left( -{1 \over 2} \left( x - c \over b \right)^2 \right)}. 24540@texline @math{{a \over b \sqrt{2 \pi}} \exp\left( -{1 \over 2} \left( x - c \over b \right)^2 \right)}.
24547@infoline @i{(a / b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)}. 24541@infoline @mathit{(a / b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)}.
24548@end table 24542@end table
24549 24543
24550All of these models are used in the usual way; just press the appropriate 24544All of these models are used in the usual way; just press the appropriate
@@ -24656,18 +24650,18 @@ Calc uses the principal values of inverse functions like @code{ln}
24656and @code{arcsin} when doing fits. For example, when you enter 24650and @code{arcsin} when doing fits. For example, when you enter
24657the model @samp{y = sin(a t + b)} Calc actually uses the easier 24651the model @samp{y = sin(a t + b)} Calc actually uses the easier
24658form @samp{arcsin(y) = a t + b}. The @code{arcsin} function always 24652form @samp{arcsin(y) = a t + b}. The @code{arcsin} function always
24659returns results in the range from @i{-90} to 90 degrees (or the 24653returns results in the range from @mathit{-90} to 90 degrees (or the
24660equivalent range in radians). Suppose you had data that you 24654equivalent range in radians). Suppose you had data that you
24661believed to represent roughly three oscillations of a sine wave, 24655believed to represent roughly three oscillations of a sine wave,
24662so that the argument of the sine might go from zero to 24656so that the argument of the sine might go from zero to
24663@texline @tmath{3\times360} 24657@texline @math{3\times360}
24664@infoline @i{3*360} 24658@infoline @mathit{3*360}
24665degrees. 24659degrees.
24666The above model would appear to be a good way to determine the 24660The above model would appear to be a good way to determine the
24667true frequency and phase of the sine wave, but in practice it 24661true frequency and phase of the sine wave, but in practice it
24668would fail utterly. The righthand side of the actual model 24662would fail utterly. The righthand side of the actual model
24669@samp{arcsin(y) = a t + b} will grow smoothly with @expr{t}, but 24663@samp{arcsin(y) = a t + b} will grow smoothly with @expr{t}, but
24670the lefthand side will bounce back and forth between @i{-90} and 90. 24664the lefthand side will bounce back and forth between @mathit{-90} and 90.
24671No values of @expr{a} and @expr{b} can make the two sides match, 24665No values of @expr{a} and @expr{b} can make the two sides match,
24672even approximately. 24666even approximately.
24673 24667
@@ -24722,16 +24716,16 @@ ln(y) = ln(a) + b ln(x)
24722 24716
24723@noindent 24717@noindent
24724which matches the desired form with 24718which matches the desired form with
24725@texline @tmath{Y = \ln(y)}, 24719@texline @math{Y = \ln(y)},
24726@infoline @expr{Y = ln(y)}, 24720@infoline @expr{Y = ln(y)},
24727@texline @tmath{A = \ln(a)}, 24721@texline @math{A = \ln(a)},
24728@infoline @expr{A = ln(a)}, 24722@infoline @expr{A = ln(a)},
24729@expr{F = 1}, @expr{B = b}, and 24723@expr{F = 1}, @expr{B = b}, and
24730@texline @tmath{G = \ln(x)}. 24724@texline @math{G = \ln(x)}.
24731@infoline @expr{G = ln(x)}. 24725@infoline @expr{G = ln(x)}.
24732Calc thus computes the logarithms of your @expr{y} and @expr{x} values, 24726Calc thus computes the logarithms of your @expr{y} and @expr{x} values,
24733does a linear fit for @expr{A} and @expr{B}, then solves to get 24727does a linear fit for @expr{A} and @expr{B}, then solves to get
24734@texline @tmath{a = \exp(A)} 24728@texline @math{a = \exp(A)}
24735@infoline @expr{a = exp(A)} 24729@infoline @expr{a = exp(A)}
24736and @expr{b = B}. 24730and @expr{b = B}.
24737 24731
@@ -24745,7 +24739,7 @@ y = a + b c^2 - 2 b c x + b x^2
24745 24739
24746@noindent 24740@noindent
24747which matches with @expr{Y = y}, @expr{A = a + b c^2}, @expr{F = 1}, 24741which matches with @expr{Y = y}, @expr{A = a + b c^2}, @expr{F = 1},
24748@expr{B = -2 b c}, @expr{G = x} (the @i{-2} factor could just as easily 24742@expr{B = -2 b c}, @expr{G = x} (the @mathit{-2} factor could just as easily
24749have been put into @expr{G} instead of @expr{B}), @expr{C = b}, and 24743have been put into @expr{G} instead of @expr{B}), @expr{C = b}, and
24750@expr{H = x^2}. 24744@expr{H = x^2}.
24751 24745
@@ -24777,7 +24771,7 @@ from the list of parameters when you answer the variables prompt.
24777A last desperate step would be to use the general-purpose 24771A last desperate step would be to use the general-purpose
24778@code{minimize} function rather than @code{fit}. After all, both 24772@code{minimize} function rather than @code{fit}. After all, both
24779functions solve the problem of minimizing an expression (the 24773functions solve the problem of minimizing an expression (the
24780@texline @tmath{\chi^2} 24774@texline @math{\chi^2}
24781@infoline @expr{chi^2} 24775@infoline @expr{chi^2}
24782sum) by adjusting certain parameters in the expression. The @kbd{a F} 24776sum) by adjusting certain parameters in the expression. The @kbd{a F}
24783command is able to use a vastly more efficient algorithm due to its 24777command is able to use a vastly more efficient algorithm due to its
@@ -24788,7 +24782,7 @@ A compromise would be to pick out a few parameters without which the
24788fit is linearizable, and use @code{minimize} on a call to @code{fit} 24782fit is linearizable, and use @code{minimize} on a call to @code{fit}
24789which efficiently takes care of the rest of the parameters. The thing 24783which efficiently takes care of the rest of the parameters. The thing
24790to be minimized would be the value of 24784to be minimized would be the value of
24791@texline @tmath{\chi^2} 24785@texline @math{\chi^2}
24792@infoline @expr{chi^2} 24786@infoline @expr{chi^2}
24793returned as the fifth result of the @code{xfit} function: 24787returned as the fifth result of the @code{xfit} function:
24794 24788
@@ -24848,11 +24842,11 @@ and @expr{y} to be plain numbers, and makes @expr{z} into an error
24848form with this combined error. The @expr{Y(x,y,z)} part of the 24842form with this combined error. The @expr{Y(x,y,z)} part of the
24849linearized model is evaluated, and the result should be an error 24843linearized model is evaluated, and the result should be an error
24850form. The error part of that result is used for 24844form. The error part of that result is used for
24851@texline @tmath{\sigma_i} 24845@texline @math{\sigma_i}
24852@infoline @expr{sigma_i} 24846@infoline @expr{sigma_i}
24853for the data point. If for some reason @expr{Y(x,y,z)} does not return 24847for the data point. If for some reason @expr{Y(x,y,z)} does not return
24854an error form, the combined error from @expr{z} is used directly for 24848an error form, the combined error from @expr{z} is used directly for
24855@texline @tmath{\sigma_i}. 24849@texline @math{\sigma_i}.
24856@infoline @expr{sigma_i}. 24850@infoline @expr{sigma_i}.
24857Finally, @expr{z} is also stripped of its error 24851Finally, @expr{z} is also stripped of its error
24858for use in computing @expr{F(x,y,z)}, @expr{G(x,y,z)} and so on; 24852for use in computing @expr{F(x,y,z)}, @expr{G(x,y,z)} and so on;
@@ -24864,7 +24858,7 @@ the most reasonable thing in the typical case that @expr{Y(x,y,z)}
24864depends only on the dependent variable @expr{z}, and in fact is 24858depends only on the dependent variable @expr{z}, and in fact is
24865often simply equal to @expr{z}. For common cases like polynomials 24859often simply equal to @expr{z}. For common cases like polynomials
24866and multilinear models, the combined error is simply used as the 24860and multilinear models, the combined error is simply used as the
24867@texline @tmath{\sigma} 24861@texline @math{\sigma}
24868@infoline @expr{sigma} 24862@infoline @expr{sigma}
24869for the data point with no further ado.) 24863for the data point with no further ado.)
24870 24864
@@ -25218,7 +25212,7 @@ If the lower limit is greater than the upper limit (assuming a
25218positive step size), the result is generally zero. However, 25212positive step size), the result is generally zero. However,
25219Calc only guarantees a zero result when the upper limit is 25213Calc only guarantees a zero result when the upper limit is
25220exactly one step less than the lower limit, i.e., if the number 25214exactly one step less than the lower limit, i.e., if the number
25221of iterations is @i{-1}. Thus @samp{sum(f(k), k, n, n-1)} is zero 25215of iterations is @mathit{-1}. Thus @samp{sum(f(k), k, n, n-1)} is zero
25222but the sum from @samp{n} to @samp{n-2} may report a nonzero value 25216but the sum from @samp{n} to @samp{n-2} may report a nonzero value
25223if Calc used a closed form solution. 25217if Calc used a closed form solution.
25224 25218
@@ -25244,7 +25238,7 @@ formula works out to the indeterminate form @expr{0 / 0}, which
25244Calc will not assume is zero. Better would be to use 25238Calc will not assume is zero. Better would be to use
25245@samp{(k != k_0) ? 1/(k-k_0) : 0}; the @samp{? :} operator does 25239@samp{(k != k_0) ? 1/(k-k_0) : 0}; the @samp{? :} operator does
25246an ``if-then-else'' test: This expression says, ``if 25240an ``if-then-else'' test: This expression says, ``if
25247@texline @tmath{k \ne k_0}, 25241@texline @math{k \ne k_0},
25248@infoline @expr{k != k_0}, 25242@infoline @expr{k != k_0},
25249then @expr{1/(k-k_0)}, else zero.'' Now the formula @expr{1/(k-k_0)} 25243then @expr{1/(k-k_0)}, else zero.'' Now the formula @expr{1/(k-k_0)}
25250will not even be evaluated by Calc when @expr{k = k_0}. 25244will not even be evaluated by Calc when @expr{k = k_0}.
@@ -25949,12 +25943,12 @@ like @samp{(x + y) + (z - w)}, are not tried.
25949 25943
25950Note that @samp{*} is not commutative when applied to matrices, but 25944Note that @samp{*} is not commutative when applied to matrices, but
25951rewrite rules pretend that it is. If you type @kbd{m v} to enable 25945rewrite rules pretend that it is. If you type @kbd{m v} to enable
25952matrix mode (@pxref{Matrix Mode}), rewrite rules will match @samp{*} 25946Matrix mode (@pxref{Matrix Mode}), rewrite rules will match @samp{*}
25953literally, ignoring its usual commutativity property. (In the 25947literally, ignoring its usual commutativity property. (In the
25954current implementation, the associativity also vanishes---it is as 25948current implementation, the associativity also vanishes---it is as
25955if the pattern had been enclosed in a @code{plain} marker; see below.) 25949if the pattern had been enclosed in a @code{plain} marker; see below.)
25956If you are applying rewrites to formulas with matrices, it's best to 25950If you are applying rewrites to formulas with matrices, it's best to
25957enable matrix mode first to prevent algebraically incorrect rewrites 25951enable Matrix mode first to prevent algebraically incorrect rewrites
25958from occurring. 25952from occurring.
25959 25953
25960The pattern @samp{-x} will actually match any expression. For example, 25954The pattern @samp{-x} will actually match any expression. For example,
@@ -26259,16 +26253,16 @@ then the rule set @samp{[f(0) := 0, import(linearF)]} will apply
26259all three rules. It is possible to modify the imported rules 26253all three rules. It is possible to modify the imported rules
26260slightly: @samp{import(x, v1, x1, v2, x2, @dots{})} imports 26254slightly: @samp{import(x, v1, x1, v2, x2, @dots{})} imports
26261the rule set @expr{x} with all occurrences of 26255the rule set @expr{x} with all occurrences of
26262@texline @tmath{v_1}, 26256@texline @math{v_1},
26263@infoline @expr{v1}, 26257@infoline @expr{v1},
26264as either a variable name or a function name, replaced with 26258as either a variable name or a function name, replaced with
26265@texline @tmath{x_1} 26259@texline @math{x_1}
26266@infoline @expr{x1} 26260@infoline @expr{x1}
26267and so on. (If 26261and so on. (If
26268@texline @tmath{v_1} 26262@texline @math{v_1}
26269@infoline @expr{v1} 26263@infoline @expr{v1}
26270is used as a function name, then 26264is used as a function name, then
26271@texline @tmath{x_1} 26265@texline @math{x_1}
26272@infoline @expr{x1} 26266@infoline @expr{x1}
26273must be either a function name itself or a @w{@samp{< >}} nameless 26267must be either a function name itself or a @w{@samp{< >}} nameless
26274function; @pxref{Specifying Operators}.) For example, @samp{[g(0) := 0, 26268function; @pxref{Specifying Operators}.) For example, @samp{[g(0) := 0,
@@ -26431,8 +26425,8 @@ You must use @code{apply} for meta-variables with function names
26431on both sides of a rewrite rule: @samp{apply(f, [x]) := f(x+1)} 26425on both sides of a rewrite rule: @samp{apply(f, [x]) := f(x+1)}
26432is @emph{not} correct, because it rewrites @samp{spam(6)} into 26426is @emph{not} correct, because it rewrites @samp{spam(6)} into
26433@samp{f(7)}. The righthand side should be @samp{apply(f, [x+1])}. 26427@samp{f(7)}. The righthand side should be @samp{apply(f, [x+1])}.
26434Also note that you will have to use no-simplify (@kbd{m O}) 26428Also note that you will have to use No-Simplify mode (@kbd{m O})
26435mode when entering this rule so that the @code{apply} isn't 26429when entering this rule so that the @code{apply} isn't
26436evaluated immediately to get the new rule @samp{f(x) := f(x+1)}. 26430evaluated immediately to get the new rule @samp{f(x) := f(x+1)}.
26437Or, use @kbd{s e} to enter the rule without going through the stack, 26431Or, use @kbd{s e} to enter the rule without going through the stack,
26438or enter the rule as @samp{apply(f, [x]) := apply(f, [x+1]) @w{:: 1}}. 26432or enter the rule as @samp{apply(f, [x]) := apply(f, [x+1]) @w{:: 1}}.
@@ -27167,7 +27161,7 @@ To apply these manually, you could put them in a variable called
27167to expand trig functions. But if instead you store them in the 27161to expand trig functions. But if instead you store them in the
27168variable @code{EvalRules}, they will automatically be applied to all 27162variable @code{EvalRules}, they will automatically be applied to all
27169sines and cosines of sums. Then, with @samp{2 x} and @samp{45} on 27163sines and cosines of sums. Then, with @samp{2 x} and @samp{45} on
27170the stack, typing @kbd{+ S} will (assuming degrees mode) result in 27164the stack, typing @kbd{+ S} will (assuming Degrees mode) result in
27171@samp{0.7071 sin(2 x) + 0.7071 cos(2 x)} automatically. 27165@samp{0.7071 sin(2 x) + 0.7071 cos(2 x)} automatically.
27172 27166
27173As each level of a formula is evaluated, the rules from 27167As each level of a formula is evaluated, the rules from
@@ -27243,11 +27237,11 @@ number @expr{(2, 3)}, Calc computes @samp{sqrt(2*2 + 3*3)} by calling
27243the multiplication, addition, and square root functions directly rather 27237the multiplication, addition, and square root functions directly rather
27244than applying the default simplifications to this formula. So an 27238than applying the default simplifications to this formula. So an
27245@code{EvalRules} rule that (perversely) rewrites @samp{sqrt(13) := 6} 27239@code{EvalRules} rule that (perversely) rewrites @samp{sqrt(13) := 6}
27246would not apply. (However, if you put Calc into symbolic mode so that 27240would not apply. (However, if you put Calc into Symbolic mode so that
27247@samp{sqrt(13)} will be left in symbolic form by the built-in square 27241@samp{sqrt(13)} will be left in symbolic form by the built-in square
27248root function, your rule will be able to apply. But if the complex 27242root function, your rule will be able to apply. But if the complex
27249number were @expr{(3,4)}, so that @samp{sqrt(25)} must be calculated, 27243number were @expr{(3,4)}, so that @samp{sqrt(25)} must be calculated,
27250then symbolic mode will not help because @samp{sqrt(25)} can be 27244then Symbolic mode will not help because @samp{sqrt(25)} can be
27251evaluated exactly to 5.) 27245evaluated exactly to 5.)
27252 27246
27253One subtle restriction that normally only manifests itself with 27247One subtle restriction that normally only manifests itself with
@@ -27354,7 +27348,7 @@ A surprisingly useful rewrite rule is @samp{a/(b-c) := a*(b+c)/(b^2-c^2)}.
27354This will simplify the formula whenever @expr{b} and/or @expr{c} can 27348This will simplify the formula whenever @expr{b} and/or @expr{c} can
27355be made simpler by squaring. For example, applying this rule to 27349be made simpler by squaring. For example, applying this rule to
27356@samp{2 / (sqrt(2) + 3)} yields @samp{6:7 - 2:7 sqrt(2)} (assuming 27350@samp{2 / (sqrt(2) + 3)} yields @samp{6:7 - 2:7 sqrt(2)} (assuming
27357Symbolic Mode has been enabled to keep the square root from being 27351Symbolic mode has been enabled to keep the square root from being
27358evaluated to a floating-point approximation). This rule is also 27352evaluated to a floating-point approximation). This rule is also
27359useful when working with symbolic complex numbers, e.g., 27353useful when working with symbolic complex numbers, e.g.,
27360@samp{(a + b i) / (c + d i)}. 27354@samp{(a + b i) / (c + d i)}.
@@ -27464,7 +27458,7 @@ formula @samp{1 mm} is ``simplified'' to @samp{mm}. This is only a
27464display anomaly, however; @samp{mm} will work just fine as a 27458display anomaly, however; @samp{mm} will work just fine as a
27465representation of one millimeter. 27459representation of one millimeter.
27466 27460
27467You may find that Algebraic Mode (@pxref{Algebraic Entry}) makes working 27461You may find that Algebraic mode (@pxref{Algebraic Entry}) makes working
27468with units expressions easier. Otherwise, you will have to remember 27462with units expressions easier. Otherwise, you will have to remember
27469to hit the apostrophe key every time you wish to enter units. 27463to hit the apostrophe key every time you wish to enter units.
27470 27464
@@ -27734,7 +27728,7 @@ in its normal terms, and @kbd{u b} expresses the definition in base
27734units. 27728units.
27735 27729
27736Two units, @code{pi} and @code{fsc} (the fine structure constant, 27730Two units, @code{pi} and @code{fsc} (the fine structure constant,
27737approximately @i{1/137}) are dimensionless. The units simplification 27731approximately @mathit{1/137}) are dimensionless. The units simplification
27738commands simply treat these names as equivalent to their corresponding 27732commands simply treat these names as equivalent to their corresponding
27739values. However you can, for example, use @kbd{u c} to convert a pure 27733values. However you can, for example, use @kbd{u c} to convert a pure
27740number into multiples of the fine structure constant, or @kbd{u b} to 27734number into multiples of the fine structure constant, or @kbd{u b} to
@@ -27951,10 +27945,10 @@ All the arithmetic stores accept the Inverse prefix to reverse the
27951order of the operands. If @expr{v} represents the contents of the 27945order of the operands. If @expr{v} represents the contents of the
27952variable, and @expr{a} is the value drawn from the stack, then regular 27946variable, and @expr{a} is the value drawn from the stack, then regular
27953@w{@kbd{s -}} assigns 27947@w{@kbd{s -}} assigns
27954@texline @tmath{v \coloneq v - a}, 27948@texline @math{v \coloneq v - a},
27955@infoline @expr{v := v - a}, 27949@infoline @expr{v := v - a},
27956but @kbd{I s -} assigns 27950but @kbd{I s -} assigns
27957@texline @tmath{v \coloneq a - v}. 27951@texline @math{v \coloneq a - v}.
27958@infoline @expr{v := a - v}. 27952@infoline @expr{v := a - v}.
27959While @kbd{I s *} might seem pointless, it is 27953While @kbd{I s *} might seem pointless, it is
27960useful if matrix multiplication is involved. Actually, all the 27954useful if matrix multiplication is involved. Actually, all the
@@ -28353,11 +28347,11 @@ including the current simplification mode. Recall that the
28353formula @samp{x + y + x} is not handled by Calc's default 28347formula @samp{x + y + x} is not handled by Calc's default
28354simplifications, but the @kbd{a s} command will reduce it to 28348simplifications, but the @kbd{a s} command will reduce it to
28355the simpler form @samp{y + 2 x}. You can also type @kbd{m A} 28349the simpler form @samp{y + 2 x}. You can also type @kbd{m A}
28356to enable an algebraic-simplification mode in which the 28350to enable an Algebraic Simplification mode in which the
28357equivalent of @kbd{a s} is used on all of Calc's results. 28351equivalent of @kbd{a s} is used on all of Calc's results.
28358If you enter @samp{x + y + x =>} normally, the result will 28352If you enter @samp{x + y + x =>} normally, the result will
28359be @samp{x + y + x => x + y + x}. If you change to 28353be @samp{x + y + x => x + y + x}. If you change to
28360algebraic-simplification mode, the result will be 28354Algebraic Simplification mode, the result will be
28361@samp{x + y + x => y + 2 x}. However, just pressing @kbd{a s} 28355@samp{x + y + x => y + 2 x}. However, just pressing @kbd{a s}
28362once will have no effect on @samp{x + y + x => x + y + x}, 28356once will have no effect on @samp{x + y + x => x + y + x},
28363because the righthand side depends only on the lefthand side 28357because the righthand side depends only on the lefthand side
@@ -28396,13 +28390,13 @@ side effects.
28396@pindex calc-assign 28390@pindex calc-assign
28397@tindex assign 28391@tindex assign
28398@tindex := 28392@tindex :=
28399Embedded Mode also uses @samp{=>} operators. In embedded mode, 28393Embedded mode also uses @samp{=>} operators. In Embedded mode,
28400the lefthand side of an @samp{=>} operator can refer to variables 28394the lefthand side of an @samp{=>} operator can refer to variables
28401assigned elsewhere in the file by @samp{:=} operators. The 28395assigned elsewhere in the file by @samp{:=} operators. The
28402assignment operator @samp{a := 17} does not actually do anything 28396assignment operator @samp{a := 17} does not actually do anything
28403by itself. But Embedded Mode recognizes it and marks it as a sort 28397by itself. But Embedded mode recognizes it and marks it as a sort
28404of file-local definition of the variable. You can enter @samp{:=} 28398of file-local definition of the variable. You can enter @samp{:=}
28405operators in algebraic mode, or by using the @kbd{s :} 28399operators in Algebraic mode, or by using the @kbd{s :}
28406(@code{calc-assign}) [@code{assign}] command which takes a variable 28400(@code{calc-assign}) [@code{assign}] command which takes a variable
28407and value from the stack and replaces them with an assignment. 28401and value from the stack and replaces them with an assignment.
28408 28402
@@ -28541,7 +28535,7 @@ the same length); either or both may instead be interval forms. The
28541``z'' value must be a matrix with the same number of rows as elements 28535``z'' value must be a matrix with the same number of rows as elements
28542in ``x'', and the same number of columns as elements in ``y''. The 28536in ``x'', and the same number of columns as elements in ``y''. The
28543result is a surface plot where 28537result is a surface plot where
28544@texline @tmath{z_{ij}} 28538@texline @math{z_{ij}}
28545@infoline @expr{z_ij} 28539@infoline @expr{z_ij}
28546is the height of the point 28540is the height of the point
28547at coordinate @expr{(x_i, y_j)} on the surface. The 3D graph will 28541at coordinate @expr{(x_i, y_j)} on the surface. The 3D graph will
@@ -28652,7 +28646,7 @@ values covered by all the curves ought to be roughly the same if
28652they are to look nice on the same graph.) 28646they are to look nice on the same graph.)
28653 28647
28654For example, to plot 28648For example, to plot
28655@texline @tmath{\sin n x} 28649@texline @math{\sin n x}
28656@infoline @expr{sin(n x)} 28650@infoline @expr{sin(n x)}
28657for integers @expr{n} 28651for integers @expr{n}
28658from 1 to 5, you could use @kbd{v x} to create a vector of integers 28652from 1 to 5, you could use @kbd{v x} to create a vector of integers
@@ -28903,7 +28897,7 @@ values, but if you store a vector of integers in one of these variables,
28903the @kbd{g a} and @kbd{g f} commands will use those style numbers 28897the @kbd{g a} and @kbd{g f} commands will use those style numbers
28904instead of the defaults for new curves that are added to the graph. 28898instead of the defaults for new curves that are added to the graph.
28905An entry should be a positive integer for a specific style, or 0 to let 28899An entry should be a positive integer for a specific style, or 0 to let
28906the style be chosen automatically, or @i{-1} to turn off lines or points 28900the style be chosen automatically, or @mathit{-1} to turn off lines or points
28907altogether. If there are more curves than elements in the vector, the 28901altogether. If there are more curves than elements in the vector, the
28908last few curves will continue to have the default styles. Of course, 28902last few curves will continue to have the default styles. Of course,
28909you can later use @kbd{g s} and @kbd{g S} to change any of these styles. 28903you can later use @kbd{g s} and @kbd{g S} to change any of these styles.
@@ -28942,7 +28936,7 @@ picture of the graph composed of characters like @code{-} and @code{|}
28942to a buffer called @samp{*Gnuplot Trail*}, which Calc then displays. 28936to a buffer called @samp{*Gnuplot Trail*}, which Calc then displays.
28943The graph is made the same size as the Emacs screen, which on most 28937The graph is made the same size as the Emacs screen, which on most
28944dumb terminals will be 28938dumb terminals will be
28945@texline @tmath{80\times24} 28939@texline @math{80\times24}
28946@infoline 80x24 28940@infoline 80x24
28947characters. The graph is displayed in 28941characters. The graph is displayed in
28948an Emacs ``recursive edit''; type @kbd{q} or @kbd{M-# M-#} to exit 28942an Emacs ``recursive edit''; type @kbd{q} or @kbd{M-# M-#} to exit
@@ -29103,7 +29097,7 @@ killing GNUPLOT because you think it has gotten stuck.
29103The commands in this chapter move information between the Calculator and 29097The commands in this chapter move information between the Calculator and
29104other Emacs editing buffers. 29098other Emacs editing buffers.
29105 29099
29106In many cases Embedded Mode is an easier and more natural way to 29100In many cases Embedded mode is an easier and more natural way to
29107work with Calc from a regular editing buffer. @xref{Embedded Mode}. 29101work with Calc from a regular editing buffer. @xref{Embedded Mode}.
29108 29102
29109@menu 29103@menu
@@ -29252,7 +29246,7 @@ would correctly split the line into two error forms.
29252 29246
29253@xref{Matrix Functions}, to see how to pull the matrix apart into its 29247@xref{Matrix Functions}, to see how to pull the matrix apart into its
29254constituent rows and columns. (If it is a 29248constituent rows and columns. (If it is a
29255@texline @tmath{1\times1} 29249@texline @math{1\times1}
29256@infoline 1x1 29250@infoline 1x1
29257matrix, just hit @kbd{v u} (@code{calc-unpack}) twice.) 29251matrix, just hit @kbd{v u} (@code{calc-unpack}) twice.)
29258 29252
@@ -29374,7 +29368,7 @@ just by double-clicking on it in the shell, then middle-clicking
29374in the Calc window. 29368in the Calc window.
29375 29369
29376@node Keypad Mode, Embedded Mode, Kill and Yank, Introduction 29370@node Keypad Mode, Embedded Mode, Kill and Yank, Introduction
29377@chapter ``Keypad'' Mode 29371@chapter Keypad Mode
29378 29372
29379@noindent 29373@noindent
29380@kindex M-# k 29374@kindex M-# k
@@ -29383,7 +29377,7 @@ The @kbd{M-# k} (@code{calc-keypad}) command starts the Calculator
29383and displays a picture of a calculator-style keypad. If you are using 29377and displays a picture of a calculator-style keypad. If you are using
29384the X window system, you can click on any of the ``keys'' in the 29378the X window system, you can click on any of the ``keys'' in the
29385keypad using the left mouse button to operate the calculator. 29379keypad using the left mouse button to operate the calculator.
29386The original window remains the selected window; in keypad mode 29380The original window remains the selected window; in Keypad mode
29387you can type in your file while simultaneously performing 29381you can type in your file while simultaneously performing
29388calculations with the mouse. 29382calculations with the mouse.
29389 29383
@@ -29399,11 +29393,11 @@ the @samp{*Calc Keypad*} window, place the cursor on the desired
29399``key,'' and type @key{SPC} or @key{RET}. If you think this 29393``key,'' and type @key{SPC} or @key{RET}. If you think this
29400is easier than using Calc normally, go right ahead. 29394is easier than using Calc normally, go right ahead.
29401 29395
29402Calc commands are more or less the same in keypad mode. Certain 29396Calc commands are more or less the same in Keypad mode. Certain
29403keypad keys differ slightly from the corresponding normal Calc 29397keypad keys differ slightly from the corresponding normal Calc
29404keystrokes; all such deviations are described below. 29398keystrokes; all such deviations are described below.
29405 29399
29406Keypad Mode includes many more commands than will fit on the keypad 29400Keypad mode includes many more commands than will fit on the keypad
29407at once. Click the right mouse button [@code{calc-keypad-menu}] 29401at once. Click the right mouse button [@code{calc-keypad-menu}]
29408to switch to the next menu. The bottom five rows of the keypad 29402to switch to the next menu. The bottom five rows of the keypad
29409stay the same; the top three rows change to a new set of commands. 29403stay the same; the top three rows change to a new set of commands.
@@ -29451,7 +29445,7 @@ original buffer.
29451@end smallexample 29445@end smallexample
29452 29446
29453@noindent 29447@noindent
29454This is the menu that appears the first time you start Keypad Mode. 29448This is the menu that appears the first time you start Keypad mode.
29455It will show up in a vertical window on the right side of your screen. 29449It will show up in a vertical window on the right side of your screen.
29456Above this menu is the traditional Calc stack display. On a 24-line 29450Above this menu is the traditional Calc stack display. On a 24-line
29457screen you will be able to see the top three stack entries. 29451screen you will be able to see the top three stack entries.
@@ -29468,7 +29462,7 @@ At other times it changes the sign of the number on the top of the
29468stack. 29462stack.
29469 29463
29470The @key{INV} and @key{HYP} keys modify other keys. As well as 29464The @key{INV} and @key{HYP} keys modify other keys. As well as
29471having the effects described elsewhere in this manual, Keypad Mode 29465having the effects described elsewhere in this manual, Keypad mode
29472defines several other ``inverse'' operations. These are described 29466defines several other ``inverse'' operations. These are described
29473below and in the following sections. 29467below and in the following sections.
29474 29468
@@ -29488,7 +29482,7 @@ The @key{EXEC} key prompts you to enter any keystroke sequence
29488that would normally work in Calc mode. This can include a 29482that would normally work in Calc mode. This can include a
29489numeric prefix if you wish. It is also possible simply to 29483numeric prefix if you wish. It is also possible simply to
29490switch into the Calc window and type commands in it; there is 29484switch into the Calc window and type commands in it; there is
29491nothing ``magic'' about this window when Keypad Mode is active. 29485nothing ``magic'' about this window when Keypad mode is active.
29492 29486
29493The other keys in this display perform their obvious calculator 29487The other keys in this display perform their obvious calculator
29494functions. @key{CLN2} rounds the top-of-stack by temporarily 29488functions. @key{CLN2} rounds the top-of-stack by temporarily
@@ -29590,7 +29584,7 @@ same limit as last time.
29590@key{INV GCD} computes the LCM (least common multiple) function. 29584@key{INV GCD} computes the LCM (least common multiple) function.
29591 29585
29592@key{INV FACT} is the gamma function. 29586@key{INV FACT} is the gamma function.
29593@texline @tmath{\Gamma(x) = (x-1)!}. 29587@texline @math{\Gamma(x) = (x-1)!}.
29594@infoline @expr{gamma(x) = (x-1)!}. 29588@infoline @expr{gamma(x) = (x-1)!}.
29595 29589
29596@key{PERM} is the number-of-permutations function, which is on the 29590@key{PERM} is the number-of-permutations function, which is on the
@@ -29767,16 +29761,16 @@ The @key{OVER} key duplicates the second-to-top stack element.
29767The @key{STO} and @key{RCL} keys are analogous to @kbd{s t} and 29761The @key{STO} and @key{RCL} keys are analogous to @kbd{s t} and
29768@kbd{s r} in regular Calc. @xref{Store and Recall}. Click the 29762@kbd{s r} in regular Calc. @xref{Store and Recall}. Click the
29769@key{STO} or @key{RCL} key, then one of the ten digits. (Named 29763@key{STO} or @key{RCL} key, then one of the ten digits. (Named
29770variables are not available in Keypad Mode.) You can also use, 29764variables are not available in Keypad mode.) You can also use,
29771for example, @kbd{STO + 3} to add to register 3. 29765for example, @kbd{STO + 3} to add to register 3.
29772 29766
29773@node Embedded Mode, Programming, Keypad Mode, Top 29767@node Embedded Mode, Programming, Keypad Mode, Top
29774@chapter Embedded Mode 29768@chapter Embedded Mode
29775 29769
29776@noindent 29770@noindent
29777Embedded Mode in Calc provides an alternative to copying numbers 29771Embedded mode in Calc provides an alternative to copying numbers
29778and formulas back and forth between editing buffers and the Calc 29772and formulas back and forth between editing buffers and the Calc
29779stack. In Embedded Mode, your editing buffer becomes temporarily 29773stack. In Embedded mode, your editing buffer becomes temporarily
29780linked to the stack and this copying is taken care of automatically. 29774linked to the stack and this copying is taken care of automatically.
29781 29775
29782@menu 29776@menu
@@ -29801,7 +29795,7 @@ are visiting your own files.
29801 29795
29802Calc normally scans backward and forward in the buffer for the 29796Calc normally scans backward and forward in the buffer for the
29803nearest opening and closing @dfn{formula delimiters}. The simplest 29797nearest opening and closing @dfn{formula delimiters}. The simplest
29804delimiters are blank lines. Other delimiters that Embedded Mode 29798delimiters are blank lines. Other delimiters that Embedded mode
29805understands are: 29799understands are:
29806 29800
29807@enumerate 29801@enumerate
@@ -30359,15 +30353,15 @@ use @kbd{M-# u} to update the buffer by hand.
30359@section Mode Settings in Embedded Mode 30353@section Mode Settings in Embedded Mode
30360 30354
30361@noindent 30355@noindent
30362Embedded Mode has a rather complicated mechanism for handling mode 30356Embedded mode has a rather complicated mechanism for handling mode
30363settings in Embedded formulas. It is possible to put annotations 30357settings in Embedded formulas. It is possible to put annotations
30364in the file that specify mode settings either global to the entire 30358in the file that specify mode settings either global to the entire
30365file or local to a particular formula or formulas. In the latter 30359file or local to a particular formula or formulas. In the latter
30366case, different modes can be specified for use when a formula 30360case, different modes can be specified for use when a formula
30367is the enabled Embedded Mode formula. 30361is the enabled Embedded mode formula.
30368 30362
30369When you give any mode-setting command, like @kbd{m f} (for fraction 30363When you give any mode-setting command, like @kbd{m f} (for Fraction
30370mode) or @kbd{d s} (for scientific notation), Embedded Mode adds 30364mode) or @kbd{d s} (for scientific notation), Embedded mode adds
30371a line like the following one to the file just before the opening 30365a line like the following one to the file just before the opening
30372delimiter of the formula. 30366delimiter of the formula.
30373 30367
@@ -30420,7 +30414,7 @@ sure the value is of a legal type or range; if you write an
30420annotation by hand, be sure to give a proper value or results 30414annotation by hand, be sure to give a proper value or results
30421will be unpredictable. Mode-setting annotations are case-sensitive. 30415will be unpredictable. Mode-setting annotations are case-sensitive.
30422 30416
30423While Embedded Mode is enabled, the word @code{Local} appears in 30417While Embedded mode is enabled, the word @code{Local} appears in
30424the mode line. This is to show that mode setting commands generate 30418the mode line. This is to show that mode setting commands generate
30425annotations that are ``local'' to the current formula or set of 30419annotations that are ``local'' to the current formula or set of
30426formulas. The @kbd{m R} (@code{calc-mode-record-mode}) command 30420formulas. The @kbd{m R} (@code{calc-mode-record-mode}) command
@@ -30436,7 +30430,7 @@ that look like this, respectively:
30436@end example 30430@end example
30437 30431
30438The first kind of annotation will be used only while a formula 30432The first kind of annotation will be used only while a formula
30439is enabled in Embedded Mode. The second kind will be used only 30433is enabled in Embedded mode. The second kind will be used only
30440when the formula is @emph{not} enabled. (Whether the formula 30434when the formula is @emph{not} enabled. (Whether the formula
30441is ``active'' or not, i.e., whether Calc has seen this formula 30435is ``active'' or not, i.e., whether Calc has seen this formula
30442yet, is not relevant here.) 30436yet, is not relevant here.)
@@ -30478,21 +30472,21 @@ We would have to go down to the other formula and press @kbd{M-# u}
30478on it in order to get it to notice the new annotation. 30472on it in order to get it to notice the new annotation.
30479 30473
30480Two more mode-recording modes selectable by @kbd{m R} are @code{Save} 30474Two more mode-recording modes selectable by @kbd{m R} are @code{Save}
30481(which works even outside of Embedded Mode), in which mode settings 30475(which works even outside of Embedded mode), in which mode settings
30482are recorded permanently in your Emacs startup file @file{~/.emacs} 30476are recorded permanently in your Emacs startup file @file{~/.emacs}
30483rather than by annotating the current document, and no-recording 30477rather than by annotating the current document, and no-recording
30484mode (where there is no symbol like @code{Save} or @code{Local} in 30478mode (where there is no symbol like @code{Save} or @code{Local} in
30485the mode line), in which mode-changing commands do not leave any 30479the mode line), in which mode-changing commands do not leave any
30486annotations at all. 30480annotations at all.
30487 30481
30488When Embedded Mode is not enabled, mode-recording modes except 30482When Embedded mode is not enabled, mode-recording modes except
30489for @code{Save} have no effect. 30483for @code{Save} have no effect.
30490 30484
30491@node Customizing Embedded Mode, , Mode Settings in Embedded Mode, Embedded Mode 30485@node Customizing Embedded Mode, , Mode Settings in Embedded Mode, Embedded Mode
30492@section Customizing Embedded Mode 30486@section Customizing Embedded Mode
30493 30487
30494@noindent 30488@noindent
30495You can modify Embedded Mode's behavior by setting various Lisp 30489You can modify Embedded mode's behavior by setting various Lisp
30496variables described here. Use @kbd{M-x set-variable} or 30490variables described here. Use @kbd{M-x set-variable} or
30497@kbd{M-x edit-options} to adjust a variable on the fly, or 30491@kbd{M-x edit-options} to adjust a variable on the fly, or
30498put a suitable @code{setq} statement in your @file{~/.emacs} 30492put a suitable @code{setq} statement in your @file{~/.emacs}
@@ -30502,7 +30496,7 @@ file; @pxref{File Variables, , Local Variables in Files, emacs, the
30502Emacs manual}.) 30496Emacs manual}.)
30503 30497
30504While none of these variables will be buffer-local by default, you 30498While none of these variables will be buffer-local by default, you
30505can make any of them local to any embedded-mode buffer. (Their 30499can make any of them local to any Embedded mode buffer. (Their
30506values in the @samp{*Calculator*} buffer are never used.) 30500values in the @samp{*Calculator*} buffer are never used.)
30507 30501
30508@vindex calc-embedded-open-formula 30502@vindex calc-embedded-open-formula
@@ -30591,7 +30585,7 @@ The default string is @code{"%%% "} (note the trailing space).
30591@vindex calc-embedded-close-plain 30585@vindex calc-embedded-close-plain
30592The @code{calc-embedded-close-plain} variable is a string which 30586The @code{calc-embedded-close-plain} variable is a string which
30593ends a ``plain'' formula. The default is @code{" %%%\n"}. Without 30587ends a ``plain'' formula. The default is @code{" %%%\n"}. Without
30594the trailing newline here, the first line of a ``big'' mode formula 30588the trailing newline here, the first line of a Big mode formula
30595that followed might be shifted over with respect to the other lines. 30589that followed might be shifted over with respect to the other lines.
30596 30590
30597@vindex calc-embedded-open-new-formula 30591@vindex calc-embedded-open-new-formula
@@ -31018,7 +31012,7 @@ forced to use upward-counting conventions. In this case, if @var{initial}
31018is greater than @var{final} the body will not be executed at all. 31012is greater than @var{final} the body will not be executed at all.
31019Note that @var{step} may still be negative in this loop; the prefix 31013Note that @var{step} may still be negative in this loop; the prefix
31020argument merely constrains the loop-finished test. Likewise, a prefix 31014argument merely constrains the loop-finished test. Likewise, a prefix
31021argument of @i{-1} forces downward-counting conventions. 31015argument of @mathit{-1} forces downward-counting conventions.
31022 31016
31023@kindex Z @{ 31017@kindex Z @{
31024@kindex Z @} 31018@kindex Z @}
@@ -31052,7 +31046,7 @@ conditional and looping commands.
31052@cindex Restoring saved modes 31046@cindex Restoring saved modes
31053Keyboard macros sometimes want to operate under known conditions 31047Keyboard macros sometimes want to operate under known conditions
31054without affecting surrounding conditions. For example, a keyboard 31048without affecting surrounding conditions. For example, a keyboard
31055macro may wish to turn on Fraction Mode, or set a particular 31049macro may wish to turn on Fraction mode, or set a particular
31056precision, independent of the user's normal setting for those 31050precision, independent of the user's normal setting for those
31057modes. 31051modes.
31058 31052
@@ -31101,7 +31095,7 @@ for all mode-setting commands inside the macro.
31101In fact, @kbd{C-u Z `} is like @kbd{Z `} except that it sets the modes 31095In fact, @kbd{C-u Z `} is like @kbd{Z `} except that it sets the modes
31102listed above to their default values. As usual, the matching @kbd{Z '} 31096listed above to their default values. As usual, the matching @kbd{Z '}
31103will restore the modes to their settings from before the @kbd{C-u Z `}. 31097will restore the modes to their settings from before the @kbd{C-u Z `}.
31104Also, @w{@kbd{Z `}} with a negative prefix argument resets algebraic mode 31098Also, @w{@kbd{Z `}} with a negative prefix argument resets the algebraic mode
31105to its default (off) but leaves the other modes the same as they were 31099to its default (off) but leaves the other modes the same as they were
31106outside the construct. 31100outside the construct.
31107 31101
@@ -31989,7 +31983,7 @@ same thing with a single division by 512.
31989@tindex mysin 31983@tindex mysin
31990A somewhat limited sine function could be defined as follows, using the 31984A somewhat limited sine function could be defined as follows, using the
31991well-known Taylor series expansion for 31985well-known Taylor series expansion for
31992@texline @tmath{\sin x}: 31986@texline @math{\sin x}:
31993@infoline @samp{sin(x)}: 31987@infoline @samp{sin(x)}:
31994 31988
31995@smallexample 31989@smallexample
@@ -32173,7 +32167,7 @@ If the first argument to @code{calc-eval} is a list whose first
32173element is a formula string, then @code{calc-eval} sets all the 32167element is a formula string, then @code{calc-eval} sets all the
32174various Calc modes to their default values while the formula is 32168various Calc modes to their default values while the formula is
32175evaluated and formatted. For example, the precision is set to 12 32169evaluated and formatted. For example, the precision is set to 12
32176digits, digit grouping is turned off, and the normal language 32170digits, digit grouping is turned off, and the Normal language
32177mode is used. 32171mode is used.
32178 32172
32179This same principle applies to the other options discussed below. 32173This same principle applies to the other options discussed below.
@@ -32196,7 +32190,7 @@ It's usually best to use this form of @code{calc-eval} unless your
32196program actually considers the interaction with Calc's mode settings 32190program actually considers the interaction with Calc's mode settings
32197to be a feature. This will avoid all sorts of potential ``gotchas''; 32191to be a feature. This will avoid all sorts of potential ``gotchas'';
32198consider what happens with @samp{(calc-eval "sqrt(2)" 'num)} 32192consider what happens with @samp{(calc-eval "sqrt(2)" 'num)}
32199when the user has left Calc in symbolic mode or no-simplify mode. 32193when the user has left Calc in Symbolic mode or No-Simplify mode.
32200 32194
32201As another example, @samp{(equal (calc-eval '("$<$$") nil a b) "1")} 32195As another example, @samp{(equal (calc-eval '("$<$$") nil a b) "1")}
32202checks if the number in string @expr{a} is less than the one in 32196checks if the number in string @expr{a} is less than the one in
@@ -32512,10 +32506,10 @@ which is not a Lisp list.
32512Large integers are stored as lists of the form @samp{(bigpos @var{d0} 32506Large integers are stored as lists of the form @samp{(bigpos @var{d0}
32513@var{d1} @var{d2} @dots{})} for positive integers 1000000 or more, or 32507@var{d1} @var{d2} @dots{})} for positive integers 1000000 or more, or
32514@samp{(bigneg @var{d0} @var{d1} @var{d2} @dots{})} for negative integers 32508@samp{(bigneg @var{d0} @var{d1} @var{d2} @dots{})} for negative integers
32515@i{-1000000} or less. Each @var{d} is a base-1000 ``digit,'' a Lisp integer 32509@mathit{-1000000} or less. Each @var{d} is a base-1000 ``digit,'' a Lisp integer
32516from 0 to 999. The least significant digit is @var{d0}; the last digit, 32510from 0 to 999. The least significant digit is @var{d0}; the last digit,
32517@var{dn}, which is always nonzero, is the most significant digit. For 32511@var{dn}, which is always nonzero, is the most significant digit. For
32518example, the integer @i{-12345678} is stored as @samp{(bigneg 678 345 12)}. 32512example, the integer @mathit{-12345678} is stored as @samp{(bigneg 678 345 12)}.
32519 32513
32520The distinction between small and large integers is entirely hidden from 32514The distinction between small and large integers is entirely hidden from
32521the user. In @code{defmath} definitions, the Lisp predicate @code{integerp} 32515the user. In @code{defmath} definitions, the Lisp predicate @code{integerp}
@@ -32536,7 +32530,7 @@ Floating-point numbers are stored in the form, @samp{(float @var{mant}
32536@samp{10^@var{p}} in absolute value (@var{p} represents the current 32530@samp{10^@var{p}} in absolute value (@var{p} represents the current
32537precision), and @var{exp} (the ``exponent'') is a fixnum. The value of 32531precision), and @var{exp} (the ``exponent'') is a fixnum. The value of
32538the float is @samp{@var{mant} * 10^@var{exp}}. For example, the number 32532the float is @samp{@var{mant} * 10^@var{exp}}. For example, the number
32539@i{-3.14} is stored as @samp{(float -314 -2) = -314*10^-2}. Other constraints 32533@mathit{-3.14} is stored as @samp{(float -314 -2) = -314*10^-2}. Other constraints
32540are that the number 0.0 is always stored as @samp{(float 0 0)}, and, 32534are that the number 0.0 is always stored as @samp{(float 0 0)}, and,
32541except for the 0.0 case, the rightmost base-10 digit of @var{mant} is 32535except for the 0.0 case, the rightmost base-10 digit of @var{mant} is
32542always nonzero. (If the rightmost digit is zero, the number is 32536always nonzero. (If the rightmost digit is zero, the number is
@@ -32772,7 +32766,7 @@ will be used.
32772This function takes a Calc object and ``normalizes'' it. At the very 32766This function takes a Calc object and ``normalizes'' it. At the very
32773least this involves re-rounding floating-point values according to the 32767least this involves re-rounding floating-point values according to the
32774current precision and other similar jobs. Also, unless the user has 32768current precision and other similar jobs. Also, unless the user has
32775selected no-simplify mode (@pxref{Simplification Modes}), this involves 32769selected No-Simplify mode (@pxref{Simplification Modes}), this involves
32776actually evaluating a formula object by executing the function calls 32770actually evaluating a formula object by executing the function calls
32777it contains, and possibly also doing algebraic simplification, etc. 32771it contains, and possibly also doing algebraic simplification, etc.
32778@end defun 32772@end defun
@@ -32848,7 +32842,7 @@ is applied to the top stack element, or, if @var{unary} is not
32848specified, nothing happens. When the argument is two or more, 32842specified, nothing happens. When the argument is two or more,
32849the binary function @var{func} is reduced across the top @var{arg} 32843the binary function @var{func} is reduced across the top @var{arg}
32850stack elements; when the argument is negative, the function is 32844stack elements; when the argument is negative, the function is
32851mapped between the next-to-top @i{-@var{arg}} stack elements and the 32845mapped between the next-to-top @mathit{-@var{arg}} stack elements and the
32852top element. 32846top element.
32853@end defun 32847@end defun
32854 32848
@@ -33134,13 +33128,13 @@ function call which led here will be left in symbolic form.
33134@end defun 33128@end defun
33135 33129
33136@defun inexact-value 33130@defun inexact-value
33137If Symbolic Mode is enabled, this will signal an error that causes 33131If Symbolic mode is enabled, this will signal an error that causes
33138@code{normalize} to leave the formula in symbolic form, with the message 33132@code{normalize} to leave the formula in symbolic form, with the message
33139``Inexact result.'' (This function has no effect when not in Symbolic Mode.) 33133``Inexact result.'' (This function has no effect when not in Symbolic mode.)
33140Note that if your function calls @samp{(sin 5)} in Symbolic Mode, the 33134Note that if your function calls @samp{(sin 5)} in Symbolic mode, the
33141@code{sin} function will call @code{inexact-value}, which will cause your 33135@code{sin} function will call @code{inexact-value}, which will cause your
33142function to be left unsimplified. You may instead wish to call 33136function to be left unsimplified. You may instead wish to call
33143@samp{(normalize (list 'calcFunc-sin 5))}, which in Symbolic Mode will 33137@samp{(normalize (list 'calcFunc-sin 5))}, which in Symbolic mode will
33144return the formula @samp{sin(5)} to your function. 33138return the formula @samp{sin(5)} to your function.
33145@end defun 33139@end defun
33146 33140
@@ -33186,9 +33180,9 @@ number of parameters, or because it returns @code{nil} or calls
33186@code{reject-arg} or @code{inexact-result}, @code{normalize} returns 33180@code{reject-arg} or @code{inexact-result}, @code{normalize} returns
33187the formula still in symbolic form. 33181the formula still in symbolic form.
33188 33182
33189If the current Simplification Mode is ``none'' or ``numeric arguments 33183If the current simplification mode is ``none'' or ``numeric arguments
33190only,'' @code{normalize} will act appropriately. However, the more 33184only,'' @code{normalize} will act appropriately. However, the more
33191powerful simplification modes (like algebraic simplification) are 33185powerful simplification modes (like Algebraic Simplification) are
33192not handled by @code{normalize}. They are handled by @code{calc-normalize}, 33186not handled by @code{normalize}. They are handled by @code{calc-normalize},
33193which calls @code{normalize} and possibly some other routines, such 33187which calls @code{normalize} and possibly some other routines, such
33194as @code{simplify} or @code{simplify-units}. Programs generally will 33188as @code{simplify} or @code{simplify-units}. Programs generally will
@@ -33267,7 +33261,7 @@ or formula, this calls @code{reject-arg}.
33267@end defun 33261@end defun
33268 33262
33269@defun compare x y 33263@defun compare x y
33270Compare the numbers @var{x} and @var{y}, and return @i{-1} if 33264Compare the numbers @var{x} and @var{y}, and return @mathit{-1} if
33271@samp{(lessp @var{x} @var{y})}, 1 if @samp{(lessp @var{y} @var{x})}, 33265@samp{(lessp @var{x} @var{y})}, 1 if @samp{(lessp @var{y} @var{x})},
332720 if @samp{(math-equal @var{x} @var{y})}, or 2 if the order is 332660 if @samp{(math-equal @var{x} @var{y})}, or 2 if the order is
33273undefined or cannot be determined. 33267undefined or cannot be determined.
@@ -33280,7 +33274,7 @@ considered to have zero digits.
33280@end defun 33274@end defun
33281 33275
33282@defun scale-int x n 33276@defun scale-int x n
33283Shift integer @var{x} left @var{n} decimal digits, or right @i{-@var{n}} 33277Shift integer @var{x} left @var{n} decimal digits, or right @mathit{-@var{n}}
33284digits with truncation toward zero. 33278digits with truncation toward zero.
33285@end defun 33279@end defun
33286 33280
@@ -33376,7 +33370,7 @@ again to 30 digits for use in the present request.
33376If the current angular mode is Degrees or HMS, this function returns the 33370If the current angular mode is Degrees or HMS, this function returns the
33377integer 360. In Radians mode, this function returns either the 33371integer 360. In Radians mode, this function returns either the
33378corresponding value in radians to the current precision, or the formula 33372corresponding value in radians to the current precision, or the formula
33379@samp{2*pi}, depending on the Symbolic Mode. There are also similar 33373@samp{2*pi}, depending on the Symbolic mode. There are also similar
33380function @code{half-circle} and @code{quarter-circle}. 33374function @code{half-circle} and @code{quarter-circle}.
33381@end defun 33375@end defun
33382 33376
@@ -33434,12 +33428,12 @@ If @var{a} is a formula, this returns the formula @samp{deg(@var{a})}.
33434@end defun 33428@end defun
33435 33429
33436@defun to-radians-2 a 33430@defun to-radians-2 a
33437Like @code{to-radians}, except that in Symbolic Mode a degrees to 33431Like @code{to-radians}, except that in Symbolic mode a degrees to
33438radians conversion yields a formula like @samp{@var{a}*pi/180}. 33432radians conversion yields a formula like @samp{@var{a}*pi/180}.
33439@end defun 33433@end defun
33440 33434
33441@defun from-radians-2 a 33435@defun from-radians-2 a
33442Like @code{from-radians}, except that in Symbolic Mode a radians to 33436Like @code{from-radians}, except that in Symbolic mode a radians to
33443degrees conversion yields a formula like @samp{@var{a}*180/pi}. 33437degrees conversion yields a formula like @samp{@var{a}*180/pi}.
33444@end defun 33438@end defun
33445 33439
@@ -33488,7 +33482,7 @@ function @code{frac}, and can be rather slow.
33488@defun quarter-integer n 33482@defun quarter-integer n
33489If @var{n} is an integer or integer-valued float, this function 33483If @var{n} is an integer or integer-valued float, this function
33490returns zero. If @var{n} is a half-integer (i.e., an integer plus 33484returns zero. If @var{n} is a half-integer (i.e., an integer plus
33491@i{1:2} or 0.5), it returns 2. If @var{n} is a quarter-integer, 33485@mathit{1:2} or 0.5), it returns 2. If @var{n} is a quarter-integer,
33492it returns 1 or 3. If @var{n} is anything else, this function 33486it returns 1 or 3. If @var{n} is anything else, this function
33493returns @code{nil}. 33487returns @code{nil}.
33494@end defun 33488@end defun
@@ -35631,8 +35625,8 @@ input data set. Each entry may be a single value or a vector of values.
35631@c 20 35625@c 20
35632@item 35626@item
35633With a prefix argument of 1, take a single 35627With a prefix argument of 1, take a single
35634@texline @tmath{@var{n}\times2} 35628@texline @var{n}@math{\times2}
35635@infoline @i{@var{N}x2} 35629@infoline @mathit{@var{N}x2}
35636matrix from the stack instead of two separate data vectors. 35630matrix from the stack instead of two separate data vectors.
35637 35631
35638@c 21 35632@c 21
@@ -35834,7 +35828,7 @@ to evaluate variables.
35834The variable is replaced by the formula shown on the right. The 35828The variable is replaced by the formula shown on the right. The
35835Inverse flag reverses the order of the operands, e.g., @kbd{I s - x} 35829Inverse flag reverses the order of the operands, e.g., @kbd{I s - x}
35836assigns 35830assigns
35837@texline @tmath{x \coloneq a-x}. 35831@texline @math{x \coloneq a-x}.
35838@infoline @expr{x := a-x}. 35832@infoline @expr{x := a-x}.
35839 35833
35840@c 48 35834@c 48
@@ -35842,7 +35836,7 @@ assigns
35842Press @kbd{?} repeatedly to see how to choose a model. Answer the 35836Press @kbd{?} repeatedly to see how to choose a model. Answer the
35843variables prompt with @expr{iv} or @expr{iv;pv} to specify 35837variables prompt with @expr{iv} or @expr{iv;pv} to specify
35844independent and parameter variables. A positive prefix argument 35838independent and parameter variables. A positive prefix argument
35845takes @i{@var{n}+1} vectors from the stack; a zero prefix takes a matrix 35839takes @mathit{@var{n}+1} vectors from the stack; a zero prefix takes a matrix
35846and a vector from the stack. 35840and a vector from the stack.
35847 35841
35848@c 49 35842@c 49
diff --git a/man/cc-mode.texi b/man/cc-mode.texi
index 2c0933a5335..89e49d67442 100644
--- a/man/cc-mode.texi
+++ b/man/cc-mode.texi
@@ -1420,7 +1420,7 @@ then as the comment prefix. It defaults to @samp{*
1420@code{c-block-comment-prefix} typically gets overriden by the default 1420@code{c-block-comment-prefix} typically gets overriden by the default
1421style @code{gnu}, which sets it to blank. You can see the line 1421style @code{gnu}, which sets it to blank. You can see the line
1422splitting effect described here by setting a different style, 1422splitting effect described here by setting a different style,
1423e.g. @code{k&r} @xref{Choosing a Style}}, which makes a comment 1423e.g. @code{k&r} @xref{Choosing a Style}.}, which makes a comment
1424 1424
1425@example 1425@example
1426/* Got O(n^2) here, which is a Bad Thing. */ 1426/* Got O(n^2) here, which is a Bad Thing. */
@@ -1643,7 +1643,7 @@ trailing backslashes.
1643@cindex font locking 1643@cindex font locking
1644@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1644@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1645 1645
1646@strong{Note:} The font locking in AWK mode is currently not integrated 1646@strong{Please note:} The font locking in AWK mode is currently not integrated
1647with the rest of @ccmode{}, so this section does not apply there. 1647with the rest of @ccmode{}, so this section does not apply there.
1648@xref{AWK Mode Font Locking}, instead. 1648@xref{AWK Mode Font Locking}, instead.
1649 1649
diff --git a/man/dired.texi b/man/dired.texi
index f19ce7e1ab0..1c5e29fe696 100644
--- a/man/dired.texi
+++ b/man/dired.texi
@@ -89,7 +89,7 @@ so common in Dired that it deserves to be easy to type.) @key{DEL}
89(move up and unflag) is often useful simply for moving up. 89(move up and unflag) is often useful simply for moving up.
90 90
91@findex dired-goto-file 91@findex dired-goto-file
92@kindex M-g 92@kindex M-g @r{(Dired)}
93 @kbd{M-g} (@code{dired-goto-file}) moves point to the line that 93 @kbd{M-g} (@code{dired-goto-file}) moves point to the line that
94describes a specified file or directory. 94describes a specified file or directory.
95 95
@@ -1113,7 +1113,7 @@ and erases all flags and marks.
1113@table @kbd 1113@table @kbd
1114@item w 1114@item w
1115@cindex Adding to the kill ring in Dired. 1115@cindex Adding to the kill ring in Dired.
1116@kindex w 1116@kindex w @r{(Dired)}
1117@findex dired-copy-filename-as-kill 1117@findex dired-copy-filename-as-kill
1118The @kbd{w} command (@code{dired-copy-filename-as-kill}) puts the 1118The @kbd{w} command (@code{dired-copy-filename-as-kill}) puts the
1119names of the marked (or next @var{n}) files into the kill ring, as if 1119names of the marked (or next @var{n}) files into the kill ring, as if
diff --git a/man/gnus-faq.texi b/man/gnus-faq.texi
index 5d243f8a02e..280280a401e 100644
--- a/man/gnus-faq.texi
+++ b/man/gnus-faq.texi
@@ -1414,7 +1414,7 @@ Answer:
1414 message. For a follow up to a newsgroup, it's 1414 message. For a follow up to a newsgroup, it's
1415 @samp{f} and @samp{F} 1415 @samp{f} and @samp{F}
1416 (analog to @samp{r} and 1416 (analog to @samp{r} and
1417 @samp{R}. 1417 @samp{R}).
1418 1418
1419 1419
1420 Enter new headers above the line saying "--text follows 1420 Enter new headers above the line saying "--text follows
diff --git a/man/mark.texi b/man/mark.texi
index b4154f9c3ae..c37bd7857e0 100644
--- a/man/mark.texi
+++ b/man/mark.texi
@@ -191,7 +191,9 @@ You can activate the new region by executing @kbd{C-x C-x}
191(@code{exchange-point-and-mark}). 191(@code{exchange-point-and-mark}).
192 192
193@item 193@item
194@kbd{C-s} when the mark is active does not alter the mark. 194Commands that normally set the mark before moving long distances (like
195@kbd{M-<} and @kbd{C-s}) do not alter the mark in Transient Mark mode
196when the mark is active.
195 197
196@item 198@item
197Some commands operate on the region if a region is active. For 199Some commands operate on the region if a region is active. For
@@ -320,6 +322,8 @@ next balanced expression (@pxref{Expressions}). These commands handle
320arguments just like @kbd{M-f} and @kbd{C-M-f}. If you repeat these 322arguments just like @kbd{M-f} and @kbd{C-M-f}. If you repeat these
321commands, the region is extended. For example, you can type either 323commands, the region is extended. For example, you can type either
322@kbd{C-u 2 M-@@} or @kbd{M-@@ M-@@} to mark the next two words. 324@kbd{C-u 2 M-@@} or @kbd{M-@@ M-@@} to mark the next two words.
325The region is also extended when the mark is active in Transient Mark
326mode, regardless of the last command.
323 327
324@kindex C-x h 328@kindex C-x h
325@findex mark-whole-buffer 329@findex mark-whole-buffer
@@ -382,9 +386,10 @@ the same buffer.
382 Many commands that can move long distances, such as @kbd{M-<} 386 Many commands that can move long distances, such as @kbd{M-<}
383(@code{beginning-of-buffer}), start by setting the mark and saving the 387(@code{beginning-of-buffer}), start by setting the mark and saving the
384old mark on the mark ring. This is to make it easier for you to move 388old mark on the mark ring. This is to make it easier for you to move
385back later. Searches set the mark if they move point. You can tell 389back later. Searches set the mark if they move point. However, in
386when a command sets the mark because it displays @samp{Mark set} in the 390Transient Mark mode, these commands do not set the mark when the mark
387echo area. 391is already active. You can tell when a command sets the mark because
392it displays @samp{Mark set} in the echo area.
388 393
389 If you want to move back to the same place over and over, the mark 394 If you want to move back to the same place over and over, the mark
390ring may not be convenient enough. If so, you can record the position 395ring may not be convenient enough. If so, you can record the position
diff --git a/man/misc.texi b/man/misc.texi
index 2adef51b8ce..e4b2806c673 100644
--- a/man/misc.texi
+++ b/man/misc.texi
@@ -2219,7 +2219,7 @@ which has a similar feature of its own.
2219@subsection Finding Files and URLs at Point 2219@subsection Finding Files and URLs at Point
2220@findex find-file-at-point 2220@findex find-file-at-point
2221@findex ffap 2221@findex ffap
2222@findex ffap-dired-at-point 2222@findex dired-at-point
2223@findex ffap-next 2223@findex ffap-next
2224@findex ffap-menu 2224@findex ffap-menu
2225@cindex finding file at point 2225@cindex finding file at point
@@ -2248,18 +2248,36 @@ make the following key bindings and to install hooks for using
2248@kindex C-x C-f @r{(FFAP)} 2248@kindex C-x C-f @r{(FFAP)}
2249Find @var{filename}, guessing a default from text around point 2249Find @var{filename}, guessing a default from text around point
2250(@code{find-file-at-point}). 2250(@code{find-file-at-point}).
2251@item C-x C-r
2252@kindex C-x C-r @r{(FFAP)}
2253@code{ffap-read-only}, analogous to @code{find-file-read-only}.
2254@item C-x C-v
2255@kindex C-x C-v @r{(FFAP)}
2256@code{ffap-alternate-file}, analogous to @code{find-alternate-file}.
2257@item C-x d @var{directory} @key{RET}
2258@kindex C-x d @r{(FFAP)}
2259Start Dired on @var{directory}, defaulting to the directory name at
2260point (@code{dired-at-point}).
2261@item C-x C-d
2262@code{ffap-list-directory}, analogous to @code{list-directory}.
2251@item C-x 4 f 2263@item C-x 4 f
2252@kindex C-x 4 f @r{(FFAP)} 2264@kindex C-x 4 f @r{(FFAP)}
2253@code{ffap-other-window}, analogous to @code{find-file-other-window}. 2265@code{ffap-other-window}, analogous to @code{find-file-other-window}.
2266@item C-x 4 r
2267@code{ffap-read-only-other-window}, analogous to
2268@code{find-file-read-only-other-window}.
2269@item C-x 4 d
2270@code{ffap-dired-other-window}, analogous to @code{dired-other-window}.
2254@item C-x 5 f 2271@item C-x 5 f
2255@kindex C-x 5 f @r{(FFAP)} 2272@kindex C-x 5 f @r{(FFAP)}
2256@code{ffap-other-frame}, analogous to @code{find-file-other-frame}. 2273@code{ffap-other-frame}, analogous to @code{find-file-other-frame}.
2274@item C-x 5 r
2275@code{ffap-read-only-other-frame}, analogous to
2276@code{find-file-read-only-other-frame}.
2277@item C-x 5 d
2278@code{ffap-dired-other-frame}, analogous to @code{dired-other-frame}.
2257@item M-x ffap-next 2279@item M-x ffap-next
2258Search buffer for next file name or URL, then find that file or URL. 2280Search buffer for next file name or URL, then find that file or URL.
2259@item C-x d @var{directory} @key{RET}
2260@kindex C-x d @r{(FFAP)}
2261Start Dired on @var{directory}, defaulting to the directory name at
2262point (@code{ffap-dired-at-point}).
2263@item S-Mouse-3 2281@item S-Mouse-3
2264@kindex S-Mouse-3 @r{(FFAP)} 2282@kindex S-Mouse-3 @r{(FFAP)}
2265@code{ffap-at-mouse} finds the file guessed from text around the position 2283@code{ffap-at-mouse} finds the file guessed from text around the position
diff --git a/man/trampver.texi b/man/trampver.texi
index 743b49388f7..45cbefb72ac 100644
--- a/man/trampver.texi
+++ b/man/trampver.texi
@@ -4,7 +4,7 @@
4@c In the Tramp CVS, the version number is auto-frobbed from 4@c In the Tramp CVS, the version number is auto-frobbed from
5@c configure.ac, so you should edit that file and run 5@c configure.ac, so you should edit that file and run
6@c "autoconf && ./configure" to change the version number. 6@c "autoconf && ./configure" to change the version number.
7@set trampver 2.0.45 7@set trampver 2.0.46
8 8
9@c Other flags from configuration 9@c Other flags from configuration
10@set prefix /usr/local 10@set prefix /usr/local
diff --git a/man/url.texi b/man/url.texi
index 5f36826d926..f5c15e2dff5 100644
--- a/man/url.texi
+++ b/man/url.texi
@@ -27,7 +27,7 @@ Copyright (C) 1993, 1994, 1995, 1996 William M. Perry
27Permission is granted to copy, distribute and/or modify this document 27Permission is granted to copy, distribute and/or modify this document
28under the terms of the GNU Free Documentation License, Version 1.1 or 28under the terms of the GNU Free Documentation License, Version 1.1 or
29any later version published by the Free Software Foundation; with the 29any later version published by the Free Software Foundation; with the
30Invariant Sections being 30Invariant Sections being
31``GNU GENERAL PUBLIC LICENSE''. A copy of the 31``GNU GENERAL PUBLIC LICENSE''. A copy of the
32license is included in the section entitled ``GNU Free Documentation 32license is included in the section entitled ``GNU Free Documentation
33License.'' 33License.''
@@ -74,9 +74,9 @@ License.''
74* General Facilities:: URLs can be cached, accessed via a gateway 74* General Facilities:: URLs can be cached, accessed via a gateway
75 and tracked in a history list. 75 and tracked in a history list.
76* Customization:: Variables you can alter. 76* Customization:: Variables you can alter.
77* Function Index:: 77* Function Index::
78* Variable Index:: 78* Variable Index::
79* Concept Index:: 79* Concept Index::
80@end menu 80@end menu
81 81
82@node Getting Started 82@node Getting Started
@@ -115,7 +115,7 @@ The meaning of
115the @var{path} component depends on the service. 115the @var{path} component depends on the service.
116 116
117@menu 117@menu
118* Configuration:: 118* Configuration::
119* Parsed URLs:: URLs are parsed into vector structures. 119* Parsed URLs:: URLs are parsed into vector structures.
120@end menu 120@end menu
121 121
@@ -204,7 +204,7 @@ Recreates a URL string from the parsed @var{url}.
204@defun url-retrieve-synchronously url 204@defun url-retrieve-synchronously url
205Retrieve @var{url} synchronously and return a buffer containing the 205Retrieve @var{url} synchronously and return a buffer containing the
206data. @var{url} is either a string or a parsed URL structure. Return 206data. @var{url} is either a string or a parsed URL structure. Return
207@var{nil} if there are no data associated with it (the case for dired, 207@code{nil} if there are no data associated with it (the case for dired,
208info, or mailto URLs that need no further processing). 208info, or mailto URLs that need no further processing).
209@end defun 209@end defun
210 210
@@ -214,7 +214,7 @@ Retrieve @var{url} asynchronously and call @var{callback} with args
214has been completely retrieved, with the current buffer containing the 214has been completely retrieved, with the current buffer containing the
215object and any MIME headers associated with it. @var{url} is either a 215object and any MIME headers associated with it. @var{url} is either a
216string or a parsed URL structure. Returns the buffer @var{url} will 216string or a parsed URL structure. Returns the buffer @var{url} will
217load into, or @var{nil} if the process has already completed. 217load into, or @code{nil} if the process has already completed.
218@end defun 218@end defun
219 219
220@node Supported URL Types 220@node Supported URL Types
@@ -222,7 +222,7 @@ load into, or @var{nil} if the process has already completed.
222 222
223@menu 223@menu
224* http/https:: Hypertext Transfer Protocol. 224* http/https:: Hypertext Transfer Protocol.
225* file/ftp:: Local files and FTP archives. 225* file/ftp:: Local files and FTP archives.
226* info:: Emacs `Info' pages. 226* info:: Emacs `Info' pages.
227* mailto:: Sending email. 227* mailto:: Sending email.
228* news/nntp/snews:: Usenet news. 228* news/nntp/snews:: Usenet news.
@@ -235,7 +235,7 @@ load into, or @var{nil} if the process has already completed.
235@c * netrek:: 235@c * netrek::
236@c * prospero:: 236@c * prospero::
237* cid:: Content-ID. 237* cid:: Content-ID.
238* about:: 238* about::
239* ldap:: Lightweight Directory Access Protocol 239* ldap:: Lightweight Directory Access Protocol
240* imap:: IMAP mailboxes. 240* imap:: IMAP mailboxes.
241* man:: Unix man pages. 241* man:: Unix man pages.
@@ -273,10 +273,10 @@ otherwise the user will be asked on each request.
273 273
274 274
275@menu 275@menu
276* Cookies:: 276* Cookies::
277* HTTP language/coding:: 277* HTTP language/coding::
278* HTTP URL Options:: 278* HTTP URL Options::
279* Dealing with HTTP documents:: 279* Dealing with HTTP documents::
280@end menu 280@end menu
281 281
282@node Cookies 282@node Cookies
@@ -330,7 +330,7 @@ preferred character set encodings, e.g.@: Latin-9 or Big5, and these
330can be weighted. In Emacs 21 this list is generated automatically 330can be weighted. In Emacs 21 this list is generated automatically
331from the list of defined coding systems which have associated MIME 331from the list of defined coding systems which have associated MIME
332types. These are sorted by coding priority. @xref{Recognize Coding, 332types. These are sorted by coding priority. @xref{Recognize Coding,
333, Recognizing Coding Systems, emacs, GNU Emacs Manual}. 333, Recognizing Coding Systems, emacs, The GNU Emacs Manual}.
334@end defopt 334@end defopt
335 335
336@defopt url-mime-language-string 336@defopt url-mime-language-string
@@ -384,9 +384,9 @@ Currently this is just the raw header contents.
384 384
385HTTP URLs are retrieved into a buffer containing the HTTP headers 385HTTP URLs are retrieved into a buffer containing the HTTP headers
386followed by the body. Since the headers are quasi-MIME, they may be 386followed by the body. Since the headers are quasi-MIME, they may be
387processed using the MIME library. @inforef{Top, The MIME library, 387processed using the MIME library. @xref{Top,, Emacs MIME,
388emacs-mime}. The URL package provides a function to do this in 388emacs-mime, The Emacs MIME Manual}. The URL package provides a
389general: 389function to do this in general:
390 390
391@defun url-decode-text-part handle &optional coding 391@defun url-decode-text-part handle &optional coding
392This function decodes charset-encoded text in the current buffer. In 392This function decodes charset-encoded text in the current buffer. In
@@ -414,8 +414,8 @@ file://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file}
414@end example 414@end example
415 415
416These schemes are defined in RFC 1808. 416These schemes are defined in RFC 1808.
417@samp{ftp:} and @samp{file:} are synonomous in this library. They 417@samp{ftp:} and @samp{file:} are synonymous in this library. They
418allow reading arbitary files from hosts. Either @samp{ange-ftp} 418allow reading arbitrary files from hosts. Either @samp{ange-ftp}
419(Emacs) or @samp{efs} (XEmacs) is used to retrieve them from remote 419(Emacs) or @samp{efs} (XEmacs) is used to retrieve them from remote
420hosts. Local files are accessed directly. 420hosts. Local files are accessed directly.
421 421
@@ -451,13 +451,13 @@ Info URLs are not officially defined. They invoke
451@cindex email 451@cindex email
452A mailto URL will send an email message to the address in the 452A mailto URL will send an email message to the address in the
453URL, for example @samp{mailto:foo@@bar.com} would compose a 453URL, for example @samp{mailto:foo@@bar.com} would compose a
454message to @samp{foo@@bar.com}. 454message to @samp{foo@@bar.com}.
455 455
456@defopt url-mail-command 456@defopt url-mail-command
457@vindex mail-user-agent 457@vindex mail-user-agent
458The function called whenever url needs to send mail. This should 458The function called whenever url needs to send mail. This should
459normally be left to default from @var{mail-user-agent}. @xref{Mail 459normally be left to default from @var{mail-user-agent}. @xref{Mail
460Methods, , Mail-Composition Methods, emacs, GNU Emacs Manual}. 460Methods, , Mail-Composition Methods, emacs, The GNU Emacs Manual}.
461@end defopt 461@end defopt
462 462
463An @samp{X-Url-From} header field containing the URL of the document 463An @samp{X-Url-From} header field containing the URL of the document
@@ -468,7 +468,7 @@ The form of a mailto URL is
468@example 468@example
469@samp{mailto:@var{mailbox}[?@var{header}=@var{contents}[&@var{header}=@var{contents}]]} 469@samp{mailto:@var{mailbox}[?@var{header}=@var{contents}[&@var{header}=@var{contents}]]}
470@end example 470@end example
471@noindent where an arbitary number of @var{header}s can be added. If the 471@noindent where an arbitrary number of @var{header}s can be added. If the
472@var{header} is @samp{body}, then @var{contents} is put in the body 472@var{header} is @samp{body}, then @var{contents} is put in the body
473otherwise a @var{header} header field is created with @var{contents} 473otherwise a @var{header} header field is created with @var{contents}
474as its contents. Note that the URL library does not consider any 474as its contents. Note that the URL library does not consider any
@@ -493,11 +493,11 @@ fields may be included in news URLs though they are properly only
493allowed for nntp an snews. 493allowed for nntp an snews.
494 494
495@table @samp 495@table @samp
496@item news:@var{newsgroup} 496@item news:@var{newsgroup}
497Retrieves a list of messages in @var{newsgroup}; 497Retrieves a list of messages in @var{newsgroup};
498@item news:@var{message-id} 498@item news:@var{message-id}
499Retrieves the message with the given @var{message-id}; 499Retrieves the message with the given @var{message-id};
500@item news:* 500@item news:*
501Retrieves a list of all available newsgroups; 501Retrieves a list of all available newsgroups;
502@item nntp://@var{host}:@var{port}/@var{newsgroup} 502@item nntp://@var{host}:@var{port}/@var{newsgroup}
503@itemx nntp://@var{host}:@var{port}/@var{message-id} 503@itemx nntp://@var{host}:@var{port}/@var{message-id}
@@ -510,7 +510,7 @@ Similar to the @samp{news} versions.
510@samp{snews} is the same as @samp{nntp} except that the default port 510@samp{snews} is the same as @samp{nntp} except that the default port
511is :563. 511is :563.
512@cindex SSL 512@cindex SSL
513(It is tunnelled through SSL.) 513(It is tunneled through SSL.)
514 514
515An @samp{nntp} URL is the same as a news URL, except that the URL may 515An @samp{nntp} URL is the same as a news URL, except that the URL may
516specify an article by its number. 516specify an article by its number.
@@ -550,9 +550,9 @@ Well-known ports are used if the URL does not specify a port.
550@cindex IRC 550@cindex IRC
551@cindex Internet Relay Chat 551@cindex Internet Relay Chat
552@cindex ZEN IRC 552@cindex ZEN IRC
553@c Fixme: reference (was http://www.w3.org/Addressing/draft-mirashi-url-irc-01.txt) 553@c Fixme: reference (was http://www.w3.org/Addressing/draft-mirashi-url-irc-01.txt)
554@dfn{Internet Relay Chat} (IRC) is handled by handing off the @sc{irc} 554@dfn{Internet Relay Chat} (IRC) is handled by handing off the @sc{irc}
555session to a function named in @code{url-irc-function}. 555session to a function named in @code{url-irc-function}.
556 556
557@defopt url-irc-function 557@defopt url-irc-function
558A function to actually open an IRC connection. 558A function to actually open an IRC connection.
@@ -582,7 +582,7 @@ including parameters. It defaults to
582@samp{text/plain;charset=US-ASCII}. The @samp{text/plain} can be 582@samp{text/plain;charset=US-ASCII}. The @samp{text/plain} can be
583omitted but the charset parameter supplied. If @samp{;base64} is 583omitted but the charset parameter supplied. If @samp{;base64} is
584present, the @var{data} are base64-encoded. 584present, the @var{data} are base64-encoded.
585 585
586@node nfs 586@node nfs
587@section nfs 587@section nfs
588@cindex NFS 588@cindex NFS
@@ -658,11 +658,11 @@ the Lisp @code{man} function.
658@chapter Defining New URLs 658@chapter Defining New URLs
659 659
660@menu 660@menu
661* Naming conventions:: 661* Naming conventions::
662* Required functions:: 662* Required functions::
663* Optional functions:: 663* Optional functions::
664* Asynchronous fetching:: 664* Asynchronous fetching::
665* Supporting file-name-handlers:: 665* Supporting file-name-handlers::
666@end menu 666@end menu
667 667
668@node Naming conventions 668@node Naming conventions
@@ -684,10 +684,10 @@ the Lisp @code{man} function.
684@chapter General Facilities 684@chapter General Facilities
685 685
686@menu 686@menu
687* Disk Caching:: 687* Disk Caching::
688* Proxies:: 688* Proxies::
689* Gateways in general:: 689* Gateways in general::
690* History:: 690* History::
691@end menu 691@end menu
692 692
693@node Disk Caching 693@node Disk Caching
@@ -761,7 +761,7 @@ more likely to conflict with other files.
761@end smallexample 761@end smallexample
762@end defun 762@end defun
763 763
764@c Fixme: never actually used currently? 764@c Fixme: never actually used currently?
765@c @defopt url-standalone-mode 765@c @defopt url-standalone-mode
766@c @cindex Relying on cache 766@c @cindex Relying on cache
767@c @cindex Cache only mode 767@c @cindex Cache only mode
@@ -783,7 +783,7 @@ more likely to conflict with other files.
783@node Proxies 783@node Proxies
784@section Proxies and Gatewaying 784@section Proxies and Gatewaying
785 785
786@c fixme: check/document url-ns stuff 786@c fixme: check/document url-ns stuff
787@cindex proxy servers 787@cindex proxy servers
788@cindex proxies 788@cindex proxies
789@cindex environment variables 789@cindex environment variables
@@ -815,7 +815,7 @@ NO_PROXY="*.aventail.com,home.com,.seanet.com"
815@noindent says to contact all machines in the @samp{aventail.com} and 815@noindent says to contact all machines in the @samp{aventail.com} and
816@samp{seanet.com} domains directly, as well as the machine named 816@samp{seanet.com} domains directly, as well as the machine named
817@samp{home.com}. If @code{NO_PROXY} isn't defined, @code{no_PROXY} 817@samp{home.com}. If @code{NO_PROXY} isn't defined, @code{no_PROXY}
818and @code{no_proxy} are also tried, in that order. 818and @code{no_proxy} are also tried, in that order.
819 819
820Proxies may also be specified directly in Lisp. 820Proxies may also be specified directly in Lisp.
821 821
@@ -940,7 +940,7 @@ This specifies the default server, it takes the form
940where @var{version} can be either 4 or 5. 940where @var{version} can be either 4 or 5.
941@end defopt 941@end defopt
942@defvar socks-password 942@defvar socks-password
943If this is @code{nil} then you will be asked for the passward, 943If this is @code{nil} then you will be asked for the password,
944otherwise it will be used as the password for authenticating you to 944otherwise it will be used as the password for authenticating you to
945the @sc{socks} server. 945the @sc{socks} server.
946@end defvar 946@end defvar
@@ -980,9 +980,9 @@ This the @samp{nslookup} program. It is @code{"nslookup"} by default.
980@end defopt 980@end defopt
981 981
982@menu 982@menu
983* Suppressing network connexions:: 983* Suppressing network connexions::
984@end menu 984@end menu
985@c * Broken hostname resolution:: 985@c * Broken hostname resolution::
986 986
987@node Suppressing network connexions 987@node Suppressing network connexions
988@subsection Suppressing Network Connexions 988@subsection Suppressing Network Connexions
@@ -1010,7 +1010,7 @@ opened by the URL library.
1010@c @cindex resolver, hostname 1010@c @cindex resolver, hostname
1011@c Some C libraries do not include the hostname resolver routines in 1011@c Some C libraries do not include the hostname resolver routines in
1012@c their static libraries. If Emacs was linked statically, and was not 1012@c their static libraries. If Emacs was linked statically, and was not
1013@c linked with the resolver libraries, it wil not be able to get to any 1013@c linked with the resolver libraries, it will not be able to get to any
1014@c machines off the local network. This is characterized by being able 1014@c machines off the local network. This is characterized by being able
1015@c to reach someplace with a raw ip number, but not its hostname 1015@c to reach someplace with a raw ip number, but not its hostname
1016@c (@url{http://129.79.254.191/} works, but 1016@c (@url{http://129.79.254.191/} works, but
@@ -1052,8 +1052,8 @@ The history `list' is actually a hash table,
1052strings. The times are in the format returned by @code{current-time}. 1052strings. The times are in the format returned by @code{current-time}.
1053 1053
1054@defun url-history-update-url url time 1054@defun url-history-update-url url time
1055This function updates the hsitory table with an entry for @var{url} 1055This function updates the history table with an entry for @var{url}
1056accessed at the gievn @var{time}. 1056accessed at the given @var{time}.
1057@end defun 1057@end defun
1058 1058
1059@defopt url-history-track 1059@defopt url-history-track
@@ -1144,7 +1144,7 @@ function taking a single argument (the prompt) and returning @code{t}
1144only if an affirmative answer is given. 1144only if an affirmative answer is given.
1145@end defopt 1145@end defopt
1146@defopt url-gateway-method 1146@defopt url-gateway-method
1147@c fixme: describe gatewaying 1147@c fixme: describe gatewaying
1148A symbol specifying the type of gateway support to use fro connexions 1148A symbol specifying the type of gateway support to use fro connexions
1149from the local machine. The supported methods are: 1149from the local machine. The supported methods are:
1150 1150