diff options
| author | Karoly Lorentey | 2004-12-23 16:43:51 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-12-23 16:43:51 +0000 |
| commit | 17d51b68fb4e7da4f18eff72c589b7ffc4f9c22c (patch) | |
| tree | f490c1ccdbd43077ea77f953bc59ca94c2fe810c /man | |
| parent | 4b89585ee70a1f64543a5851f07cf7e2d89c5c62 (diff) | |
| parent | 55f4edbcd246d8ea1715687a7aeeb3afe35c0345 (diff) | |
| download | emacs-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/ChangeLog | 66 | ||||
| -rw-r--r-- | man/calc.texi | 1202 | ||||
| -rw-r--r-- | man/cc-mode.texi | 4 | ||||
| -rw-r--r-- | man/dired.texi | 4 | ||||
| -rw-r--r-- | man/gnus-faq.texi | 2 | ||||
| -rw-r--r-- | man/mark.texi | 13 | ||||
| -rw-r--r-- | man/misc.texi | 28 | ||||
| -rw-r--r-- | man/trampver.texi | 2 | ||||
| -rw-r--r-- | man/url.texi | 94 |
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 @@ | |||
| 1 | 2004-12-20 Jay Belanger <belanger@truman.edu> | ||
| 2 | |||
| 3 | * calc.texi (Types Tutorial): Emphasized that you can't divide by | ||
| 4 | zero. | ||
| 5 | |||
| 6 | 2004-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 | |||
| 12 | 2004-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 | |||
| 18 | 2004-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 | |||
| 26 | 2004-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 | |||
| 32 | 2004-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 | |||
| 38 | 2004-12-13 Jay Belanger <belanger@truman.edu> | ||
| 39 | |||
| 40 | * calc.texi: Fix some TeX definitions. | ||
| 41 | |||
| 42 | 2004-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 | |||
| 50 | 2004-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 | |||
| 1 | 2004-12-09 Luc Teirlinck <teirllm@auburn.edu> | 55 | 2004-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 | ||
| 190 | 2004-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 | |||
| 136 | 2004-11-22 Reiner Steib <Reiner.Steib@gmx.de> | 197 | 2004-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 | ||
| 143 | 2004-11-16 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 144 | |||
| 145 | * gnus.texi (Filtering Spam Using The Spam ELisp Package): Index | ||
| 146 | `spam-initialize'. | ||
| 147 | |||
| 148 | 2004-11-02 Katsumi Yamaoka <yamaoka@jpl.org> | 204 | 2004-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. | |||
| 470 | Moving data to and from regular editing buffers. | 463 | Moving data to and from regular editing buffers. |
| 471 | 464 | ||
| 472 | @item | 465 | @item |
| 473 | ``Embedded mode'' for manipulating Calc formulas and data directly | 466 | Embedded mode for manipulating Calc formulas and data directly |
| 474 | inside any editing buffer. | 467 | inside 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 |
| 626 | Type @kbd{2 @key{RET} 3 + Q} to compute | 619 | Type @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 |
| 631 | Type @kbd{P 2 ^} to compute | 624 | Type @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 |
| 650 | Type @kbd{' sqrt(2+3) @key{RET}} to compute | 643 | Type @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 |
| 655 | Type @kbd{' pi^2 @key{RET}} to enter | 648 | Type @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. |
| 658 | To evaluate this symbolic formula as a number, type @kbd{=}. | 651 | To 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 |
| 715 | Type @kbd{v t} to transpose this | 708 | Type @kbd{v t} to transpose this |
| 716 | @texline @tmath{3\times2} | 709 | @texline @math{3\times2} |
| 717 | @infoline 3x2 | 710 | @infoline 3x2 |
| 718 | matrix into a | 711 | matrix into a |
| 719 | @texline @tmath{2\times3} | 712 | @texline @math{2\times3} |
| 720 | @infoline 2x3 | 713 | @infoline 2x3 |
| 721 | matrix. Type @w{@kbd{v u}} to unpack the rows into two separate | 714 | matrix. Type @w{@kbd{v u}} to unpack the rows into two separate |
| 722 | vectors. Now type @w{@kbd{V R + @key{TAB} V R +}} to compute the sums | 715 | vectors. 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 |
| 774 | Calc has several user interfaces that are specialized for | 767 | Calc has several user interfaces that are specialized for |
| 775 | different kinds of tasks. As well as Calc's standard interface, | 768 | different kinds of tasks. As well as Calc's standard interface, |
| 776 | there are Quick Mode, Keypad Mode, and Embedded Mode. | 769 | there 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 | |||
| 808 | want to use. | 801 | want to use. |
| 809 | 802 | ||
| 810 | To get Calc's standard interface, type @kbd{M-# c}. To get | 803 | To get Calc's standard interface, type @kbd{M-# c}. To get |
| 811 | Keypad Mode, type @kbd{M-# k}. Type @kbd{M-# ?} to get a brief | 804 | Keypad mode, type @kbd{M-# k}. Type @kbd{M-# ?} to get a brief |
| 812 | list of the available options, and type a second @kbd{?} to get | 805 | list of the available options, and type a second @kbd{?} to get |
| 813 | a complete list. | 806 | a complete list. |
| 814 | 807 | ||
| @@ -821,7 +814,7 @@ function key twice is just like hitting @kbd{M-# M-#}.) | |||
| 821 | 814 | ||
| 822 | If @kbd{M-#} doesn't work for you, you can always type explicit | 815 | If @kbd{M-#} doesn't work for you, you can always type explicit |
| 823 | commands like @kbd{M-x calc} (for the standard user interface) or | 816 | commands 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, |
| 826 | type the full command (like @kbd{calc-keypad}) and press Return. | 819 | type the full command (like @kbd{calc-keypad}) and press Return. |
| 827 | 820 | ||
| @@ -867,9 +860,9 @@ you do. | |||
| 867 | 860 | ||
| 868 | In this case, the trail shows that four numbers (17.3, 3, 2, and 4) | 861 | In this case, the trail shows that four numbers (17.3, 3, 2, and 4) |
| 869 | were first entered into the Calculator, then the 2 and 4 were | 862 | were first entered into the Calculator, then the 2 and 4 were |
| 870 | multiplied to get 8, then the 3 and 8 were subtracted to get @i{-5}. | 863 | multiplied 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.) |
| 872 | The net result is the two numbers 17.3 and @i{-5} sitting on the stack. | 865 | The net result is the two numbers 17.3 and @mathit{-5} sitting on the stack. |
| 873 | 866 | ||
| 874 | Most Calculator commands deal explicitly with the stack only, but | 867 | Most Calculator commands deal explicitly with the stack only, but |
| 875 | there is a set of commands that allow you to search back through | 868 | there 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 |
| 928 | full complexity of the stack and trail. To use it, type @kbd{M-# q} | 921 | full 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 | ||
| 931 | Quick Mode is very simple: It prompts you to type any formula in | 924 | Quick mode is very simple: It prompts you to type any formula in |
| 932 | standard algebraic notation (like @samp{4 - 2/3}) and then displays | 925 | standard algebraic notation (like @samp{4 - 2/3}) and then displays |
| 933 | the result at the bottom of the Emacs screen (@i{3.33333333333} | 926 | the result at the bottom of the Emacs screen (@mathit{3.33333333333} |
| 934 | in this case). You are then back in the same editing buffer you | 927 | in this case). You are then back in the same editing buffer you |
| 935 | were in before, ready to continue editing or to type @kbd{M-# q} | 928 | were in before, ready to continue editing or to type @kbd{M-# q} |
| 936 | again to do another quick calculation. The result of the calculation | 929 | again to do another quick calculation. The result of the calculation |
| 937 | will also be in the Emacs ``kill ring'' so that a @kbd{C-y} command | 930 | will also be in the Emacs ``kill ring'' so that a @kbd{C-y} command |
| 938 | at this point will yank the result into your editing buffer. | 931 | at this point will yank the result into your editing buffer. |
| 939 | 932 | ||
| 940 | Calc mode settings affect Quick Mode, too, though you will have to | 933 | Calc mode settings affect Quick mode, too, though you will have to |
| 941 | go into regular Calc (with @kbd{M-# c}) to change the mode settings. | 934 | go 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. |
| 951 | It is designed for use with terminals that support a mouse. If you | 944 | It is designed for use with terminals that support a mouse. If you |
| 952 | don't have a mouse, you will have to operate keypad mode with your | 945 | don't have a mouse, you will have to operate Keypad mode with your |
| 953 | arrow keys (which is probably more trouble than it's worth). | 946 | arrow keys (which is probably more trouble than it's worth). |
| 954 | 947 | ||
| 955 | Type @kbd{M-# k} to turn Keypad Mode on or off. Once again you | 948 | Type @kbd{M-# k} to turn Keypad mode on or off. Once again you |
| 956 | get two new windows, this time on the righthand side of the screen | 949 | get two new windows, this time on the righthand side of the screen |
| 957 | instead of at the bottom. The upper window is the familiar Calc | 950 | instead of at the bottom. The upper window is the familiar Calc |
| 958 | Stack; the lower window is a picture of a typical calculator keypad. | 951 | Stack; 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 | ||
| 991 | Keypad Mode is much easier for beginners to learn, because there | 984 | Keypad mode is much easier for beginners to learn, because there |
| 992 | is no need to memorize lots of obscure key sequences. But not all | 985 | is no need to memorize lots of obscure key sequences. But not all |
| 993 | commands in regular Calc are available on the Keypad. You can | 986 | commands in regular Calc are available on the Keypad. You can |
| 994 | always switch the cursor into the Calc stack window to use | 987 | always switch the cursor into the Calc stack window to use |
| 995 | standard Calc commands if you need. Serious Calc users, though, | 988 | standard Calc commands if you need. Serious Calc users, though, |
| 996 | often find they prefer the standard interface over Keypad Mode. | 989 | often find they prefer the standard interface over Keypad mode. |
| 997 | 990 | ||
| 998 | To operate the Calculator, just click on the ``buttons'' of the | 991 | To operate the Calculator, just click on the ``buttons'' of the |
| 999 | keypad using your left mouse button. To enter the two numbers | 992 | keypad 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 | |||
| 1006 | math functions, vector operations, and operations on binary | 999 | math functions, vector operations, and operations on binary |
| 1007 | numbers. | 1000 | numbers. |
| 1008 | 1001 | ||
| 1009 | Because Keypad Mode doesn't use the regular keyboard, Calc leaves | 1002 | Because Keypad mode doesn't use the regular keyboard, Calc leaves |
| 1010 | the cursor in your original editing buffer. You can type in | 1003 | the cursor in your original editing buffer. You can type in |
| 1011 | this buffer in the usual way while also clicking on the Calculator | 1004 | this buffer in the usual way while also clicking on the Calculator |
| 1012 | keypad. One advantage of Keypad Mode is that you don't need an | 1005 | keypad. One advantage of Keypad mode is that you don't need an |
| 1013 | explicit command to switch between editing and calculating. | 1006 | explicit command to switch between editing and calculating. |
| 1014 | 1007 | ||
| 1015 | If you press @kbd{M-# b} first, you get a full-screen Keypad Mode | 1008 | If 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 |
| 1017 | left, the stack in the lower right, and the trail on top. | 1010 | left, 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 |
| 1054 | editing buffer. Suppose you have a formula written as part of a | 1047 | editing buffer. Suppose you have a formula written as part of a |
| 1055 | document like this: | 1048 | document like this: |
| 1056 | 1049 | ||
| @@ -1067,7 +1060,7 @@ is | |||
| 1067 | @noindent | 1060 | @noindent |
| 1068 | and you wish to have Calc compute and format the derivative for | 1061 | and you wish to have Calc compute and format the derivative for |
| 1069 | you and store this derivative in the buffer automatically. To | 1062 | you and store this derivative in the buffer automatically. To |
| 1070 | do this with Embedded Mode, first copy the formula down to where | 1063 | do this with Embedded mode, first copy the formula down to where |
| 1071 | you want the result to be: | 1064 | you want the result to be: |
| 1072 | 1065 | ||
| 1073 | @smallexample | 1066 | @smallexample |
| @@ -1106,7 +1099,7 @@ is | |||
| 1106 | @end smallexample | 1099 | @end smallexample |
| 1107 | 1100 | ||
| 1108 | To make this look nicer, you might want to press @kbd{d =} to center | 1101 | To make this look nicer, you might want to press @kbd{d =} to center |
| 1109 | the formula, and even @kbd{d B} to use ``big'' display mode. | 1102 | the 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 | ||
| 1149 | To leave Embedded Mode, type @kbd{M-# e} again. The mode line | 1142 | To leave Embedded mode, type @kbd{M-# e} again. The mode line |
| 1150 | and keyboard will revert to the way they were before. (If you have | 1143 | and keyboard will revert to the way they were before. (If you have |
| 1151 | actually been trying this as you read along, you'll want to press | 1144 | actually 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 | ||
| 1163 | Place the cursor on the @samp{1}, then type @kbd{M-# w} to enable | 1156 | Place the cursor on the @samp{1}, then type @kbd{M-# w} to enable |
| 1164 | Embedded Mode on that number. Now type @kbd{3 /} (to get one-third), | 1157 | Embedded mode on that number. Now type @kbd{3 /} (to get one-third), |
| 1165 | and @kbd{I T} (the Inverse Tangent converts a slope into an angle), | 1158 | and @kbd{I T} (the Inverse Tangent converts a slope into an angle), |
| 1166 | then @w{@kbd{M-# w}} again to exit Embedded mode. | 1159 | then @w{@kbd{M-# w}} again to exit Embedded mode. |
| 1167 | 1160 | ||
| @@ -1228,7 +1221,7 @@ move it out of that window. | |||
| 1228 | Control whether @kbd{M-# c} and @kbd{M-# k} use the full screen. | 1221 | Control whether @kbd{M-# c} and @kbd{M-# k} use the full screen. |
| 1229 | 1222 | ||
| 1230 | @item Q | 1223 | @item Q |
| 1231 | Use Quick Mode for a single short calculation. | 1224 | Use Quick mode for a single short calculation. |
| 1232 | 1225 | ||
| 1233 | @item K | 1226 | @item K |
| 1234 | Turn Calc Keypad mode on or off. | 1227 | Turn 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 |
| 1280 | Commands for use with Embedded Mode: | 1273 | Commands 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. | |||
| 1343 | Calc was originally started as a two-week project to occupy a lull | 1336 | Calc was originally started as a two-week project to occupy a lull |
| 1344 | in the author's schedule. Basically, a friend asked if I remembered | 1337 | in the author's schedule. Basically, a friend asked if I remembered |
| 1345 | the value of | 1338 | the value of |
| 1346 | @texline @tmath{2^{32}}. | 1339 | @texline @math{2^{32}}. |
| 1347 | @infoline @expr{2^32}. | 1340 | @infoline @expr{2^32}. |
| 1348 | I didn't offhand, but I said, ``that's easy, just call up an | 1341 | I 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] |
| 1487 | This tutorial describes the standard user interface of Calc only. | 1480 | This tutorial describes the standard user interface of Calc only. |
| 1488 | The ``Quick Mode'' and ``Keypad Mode'' interfaces are fairly | 1481 | The Quick mode and Keypad mode interfaces are fairly |
| 1489 | self-explanatory. @xref{Embedded Mode}, for a description of | 1482 | self-explanatory. @xref{Embedded Mode}, for a description of |
| 1490 | the ``Embedded Mode'' interface. | 1483 | the Embedded mode interface. |
| 1491 | 1484 | ||
| 1492 | @ifinfo | 1485 | @ifinfo |
| 1493 | The easiest way to read this tutorial on-line is to have two windows on | 1486 | The 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 | |||
| 1665 | if you're right. @xref{RPN Answer 1, 1}. (@bullet{}) | 1658 | if 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} |
| 1670 | using the stack. @xref{RPN Answer 2, 2}. (@bullet{}) | 1663 | using the stack. @xref{RPN Answer 2, 2}. (@bullet{}) |
| 1671 | 1664 | ||
| @@ -1947,8 +1940,8 @@ entire stack.) | |||
| 1947 | 1940 | ||
| 1948 | @noindent | 1941 | @noindent |
| 1949 | If you are not used to RPN notation, you may prefer to operate the | 1942 | If you are not used to RPN notation, you may prefer to operate the |
| 1950 | Calculator in ``algebraic mode,'' which is closer to the way | 1943 | Calculator in Algebraic mode, which is closer to the way |
| 1951 | non-RPN calculators work. In algebraic mode, you enter formulas | 1944 | non-RPN calculators work. In Algebraic mode, you enter formulas |
| 1952 | in traditional @expr{2+3} notation. | 1945 | in traditional @expr{2+3} notation. |
| 1953 | 1946 | ||
| 1954 | You don't really need any special ``mode'' to enter algebraic formulas. | 1947 | You 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 |
| 2003 | The result of this expression will be the number @i{-6.99999826533}. | 1996 | The result of this expression will be the number @mathit{-6.99999826533}. |
| 2004 | 1997 | ||
| 2005 | Calc's order of evaluation is the same as for most computer languages, | 1998 | Calc's order of evaluation is the same as for most computer languages, |
| 2006 | except that @samp{*} binds more strongly than @samp{/}, as the above | 1999 | except 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 | ||
| 2010 | Operators at the same level are evaluated from left to right, except | 2003 | Operators at the same level are evaluated from left to right, except |
| 2011 | that @samp{^} is evaluated from right to left. Thus, @samp{2-3-4} is | 2004 | that @samp{^} is evaluated from right to left. Thus, @samp{2-3-4} is |
| 2012 | equivalent to @samp{(2-3)-4} or @i{-5}, whereas @samp{2^3^4} is equivalent | 2005 | equivalent to @samp{(2-3)-4} or @mathit{-5}, whereas @samp{2^3^4} is equivalent |
| 2013 | to @samp{2^(3^4)} (a very large integer; try it!). | 2006 | to @samp{2^(3^4)} (a very large integer; try it!). |
| 2014 | 2007 | ||
| 2015 | If you tire of typing the apostrophe all the time, there is an | 2008 | If you tire of typing the apostrophe all the time, there is |
| 2016 | ``algebraic mode'' you can select in which Calc automatically senses | 2009 | Algebraic mode, where Calc automatically senses |
| 2017 | when you are about to type an algebraic expression. To enter this | 2010 | when you are about to type an algebraic expression. To enter this |
| 2018 | mode, press the two letters @w{@kbd{m a}}. (An @samp{Alg} indicator | 2011 | mode, press the two letters @w{@kbd{m a}}. (An @samp{Alg} indicator |
| 2019 | should appear in the Calc window's mode line.) | 2012 | should appear in the Calc window's mode line.) |
| 2020 | 2013 | ||
| 2021 | Press @kbd{m a}, then @kbd{2+3+4} with no apostrophe, then @key{RET}. | 2014 | Press @kbd{m a}, then @kbd{2+3+4} with no apostrophe, then @key{RET}. |
| 2022 | 2015 | ||
| 2023 | In algebraic mode, when you press any key that would normally begin | 2016 | In Algebraic mode, when you press any key that would normally begin |
| 2024 | entering a number (such as a digit, a decimal point, or the @kbd{_} | 2017 | entering a number (such as a digit, a decimal point, or the @kbd{_} |
| 2025 | key), or if you press @kbd{(} or @kbd{[}, Calc automatically begins | 2018 | key), or if you press @kbd{(} or @kbd{[}, Calc automatically begins |
| 2026 | an algebraic entry. | 2019 | an algebraic entry. |
| @@ -2035,7 +2028,7 @@ Press the apostrophe, then type @kbd{sqrt(5*2) - 3}. The result should | |||
| 2035 | be @expr{0.16227766017}. | 2028 | be @expr{0.16227766017}. |
| 2036 | 2029 | ||
| 2037 | Note that if the formula begins with a function name, you need to use | 2030 | Note that if the formula begins with a function name, you need to use |
| 2038 | the apostrophe even if you are in algebraic mode. If you type @kbd{arcsin} | 2031 | the apostrophe even if you are in Algebraic mode. If you type @kbd{arcsin} |
| 2039 | out of the blue, the @kbd{a r} will be taken as an Algebraic Rewrite | 2032 | out of the blue, the @kbd{a r} will be taken as an Algebraic Rewrite |
| 2040 | command, and the @kbd{csin} will be taken as the name of the rewrite | 2033 | command, and the @kbd{csin} will be taken as the name of the rewrite |
| 2041 | rule to use! | 2034 | rule to use! |
| @@ -2044,7 +2037,7 @@ Some people prefer to enter complex numbers and vectors in algebraic | |||
| 2044 | form because they find RPN entry with incomplete objects to be too | 2037 | form because they find RPN entry with incomplete objects to be too |
| 2045 | distracting, even though they otherwise use Calc as an RPN calculator. | 2038 | distracting, even though they otherwise use Calc as an RPN calculator. |
| 2046 | 2039 | ||
| 2047 | Still in algebraic mode, type: | 2040 | Still 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 | |||
| 2060 | an apostrophe first, but it also means we need to press @key{RET} | 2053 | an apostrophe first, but it also means we need to press @key{RET} |
| 2061 | after every entry, even for a simple number like @expr{1}. | 2054 | after 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 |
| 2064 | mode'' in which the @kbd{(} and @kbd{[} keys use algebraic entry even | 2057 | mode in which the @kbd{(} and @kbd{[} keys use algebraic entry even |
| 2065 | though regular numeric keys still use RPN numeric entry. There is also | 2058 | though regular numeric keys still use RPN numeric entry. There is also |
| 2066 | a ``total algebraic mode,'' started by typing @kbd{m t}, in which all | 2059 | Total Algebraic mode, started by typing @kbd{m t}, in which all |
| 2067 | normal keys begin algebraic entry. You must then use the @key{META} key | 2060 | normal keys begin algebraic entry. You must then use the @key{META} key |
| 2068 | to type Calc commands: @kbd{M-m t} to get back out of total algebraic | 2061 | to type Calc commands: @kbd{M-m t} to get back out of Total Algebraic |
| 2069 | mode, @kbd{M-q} to quit, etc.) | 2062 | mode, @kbd{M-q} to quit, etc.) |
| 2070 | 2063 | ||
| 2071 | If you're still in algebraic mode, press @kbd{m a} again to turn it off. | 2064 | If you're still in Algebraic mode, press @kbd{m a} again to turn it off. |
| 2072 | 2065 | ||
| 2073 | Actual non-RPN calculators use a mixture of algebraic and RPN styles. | 2066 | Actual non-RPN calculators use a mixture of algebraic and RPN styles. |
| 2074 | In general, operators of two numbers (like @kbd{+} and @kbd{*}) | 2067 | In general, operators of two numbers (like @kbd{+} and @kbd{*}) |
| @@ -2079,7 +2072,7 @@ accomplish this in Calc by performing your calculation as a series | |||
| 2079 | of algebraic entries, using the @kbd{$} sign to tie them together. | 2072 | of algebraic entries, using the @kbd{$} sign to tie them together. |
| 2080 | In an algebraic formula, @kbd{$} represents the number on the top | 2073 | In an algebraic formula, @kbd{$} represents the number on the top |
| 2081 | of the stack. Here, we perform the calculation | 2074 | of 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)}, |
| 2084 | which on a traditional calculator would be done by pressing | 2077 | which 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 |
| 2384 | Calc has many types of @dfn{modes} that affect the way it interprets | 2377 | Calc has many types of @dfn{modes} that affect the way it interprets |
| 2385 | your commands or the way it displays data. We have already seen one | 2378 | your commands or the way it displays data. We have already seen one |
| 2386 | mode, namely algebraic mode. There are many others, too; we'll | 2379 | mode, namely Algebraic mode. There are many others, too; we'll |
| 2387 | try some of the most common ones here. | 2380 | try some of the most common ones here. |
| 2388 | 2381 | ||
| 2389 | Perhaps the most fundamental mode in Calc is the current @dfn{precision}. | 2382 | Perhaps 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 |
| 2742 | The shift-@kbd{S} command computes the sine of an angle. The sine | 2735 | The shift-@kbd{S} command computes the sine of an angle. The sine |
| 2743 | of 45 degrees is | 2736 | of 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}; |
| 2746 | squaring this yields @expr{2/4 = 0.5}. However, there has been a slight | 2739 | squaring this yields @expr{2/4 = 0.5}. However, there has been a slight |
| 2747 | roundoff error because the representation of | 2740 | roundoff 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} |
| 2750 | wasn't exact. The @kbd{c 1} command is a handy way to clean up numbers | 2743 | wasn't exact. The @kbd{c 1} command is a handy way to clean up numbers |
| 2751 | in this case; it temporarily reduces the precision by one digit while it | 2744 | in 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 |
| 2788 | Here we compute the Inverse Sine of | 2781 | Here 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)}, |
| 2791 | first in radians, then in degrees. | 2784 | first 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 | ||
| 2805 | Another interesting mode is @dfn{fraction mode}. Normally, | 2798 | Another interesting mode is @dfn{Fraction mode}. Normally, |
| 2806 | dividing two integers produces a floating-point result if the | 2799 | dividing two integers produces a floating-point result if the |
| 2807 | quotient can't be expressed as an exact integer. Fraction mode | 2800 | quotient can't be expressed as an exact integer. Fraction mode |
| 2808 | causes integer division to produce a fraction, i.e., a rational | 2801 | causes 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 |
| 2827 | because @kbd{/} is already used to divide the top two stack | 2820 | because @kbd{/} is already used to divide the top two stack |
| 2828 | elements.) Calculations involving fractions will always | 2821 | elements.) Calculations involving fractions will always |
| 2829 | produce exact fractional results; fraction mode only says | 2822 | produce exact fractional results; Fraction mode only says |
| 2830 | what to do when dividing two integers. | 2823 | what 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 | ||
| 2838 | Typing @kbd{m f} doesn't change any existing values in the stack. | 2831 | Typing @kbd{m f} doesn't change any existing values in the stack. |
| 2839 | In the above example, we had to Undo the division and do it over | 2832 | In the above example, we had to Undo the division and do it over |
| 2840 | again when we changed to fraction mode. But if you use the | 2833 | again when we changed to Fraction mode. But if you use the |
| 2841 | evaluates-to operator you can get commands like @kbd{m f} to | 2834 | evaluates-to operator you can get commands like @kbd{m f} to |
| 2842 | recompute for you. | 2835 | recompute for you. |
| 2843 | 2836 | ||
| @@ -2853,7 +2846,7 @@ recompute for you. | |||
| 2853 | @noindent | 2846 | @noindent |
| 2854 | In this example, the righthand side of the @samp{=>} operator | 2847 | In this example, the righthand side of the @samp{=>} operator |
| 2855 | on the stack is recomputed when we change the precision, then | 2848 | on the stack is recomputed when we change the precision, then |
| 2856 | again when we change to fraction mode. All @samp{=>} expressions | 2849 | again when we change to Fraction mode. All @samp{=>} expressions |
| 2857 | on the stack are recomputed every time you change any mode that | 2850 | on the stack are recomputed every time you change any mode that |
| 2858 | might affect their values. | 2851 | might affect their values. |
| 2859 | 2852 | ||
| @@ -2974,9 +2967,9 @@ logarithm). These can be modified by the @kbd{I} (inverse) and | |||
| 2974 | 2967 | ||
| 2975 | Let's compute the sine and cosine of an angle, and verify the | 2968 | Let's compute the sine and cosine of an angle, and verify the |
| 2976 | identity | 2969 | identity |
| 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}. |
| 2979 | We'll arbitrarily pick @i{-64} degrees as a good value for @expr{x}. | 2972 | We'll arbitrarily pick @mathit{-64} degrees as a good value for @expr{x}. |
| 2980 | With the angular mode set to degrees (type @w{@kbd{m d}}), do: | 2973 | With 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 | |||
| 2997 | of squares, command. | 2990 | of squares, command. |
| 2998 | 2991 | ||
| 2999 | Another identity is | 2992 | Another 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 | ||
| 3013 | A physical interpretation of this calculation is that if you move | 3006 | A 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, |
| 3015 | your direction of motion is @i{-64} degrees from horizontal. Suppose | 3008 | your direction of motion is @mathit{-64} degrees from horizontal. Suppose |
| 3016 | we move in the opposite direction, up and to the left: | 3009 | we 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 | ||
| 3061 | A similar identity is supposed to hold for hyperbolic sines and cosines, | 3054 | A similar identity is supposed to hold for hyperbolic sines and cosines, |
| 3062 | except that it is the @emph{difference} | 3055 | except 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} |
| 3065 | that always equals one. Let's try to verify this identity. | 3058 | that always equals one. Let's try to verify this identity. |
| 3066 | 3059 | ||
| @@ -3167,7 +3160,7 @@ in this case). | |||
| 3167 | 3160 | ||
| 3168 | If you take the factorial of a non-integer, Calc uses a generalized | 3161 | If you take the factorial of a non-integer, Calc uses a generalized |
| 3169 | factorial function defined in terms of Euler's Gamma function | 3162 | factorial 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 |
| 3186 | Here we verify the identity | 3179 | Here 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 | ||
| 3190 | The binomial coefficient @var{n}-choose-@var{m} | 3183 | The binomial coefficient @var{n}-choose-@var{m} |
| 3191 | @texline or @tmath{\displaystyle {n \choose m}} | 3184 | @texline or @math{\displaystyle {n \choose m}} |
| 3192 | is defined by | 3185 | is 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)!} |
| 3195 | for all reals @expr{n} and @expr{m}. The intermediate results in this | 3188 | for all reals @expr{n} and @expr{m}. The intermediate results in this |
| 3196 | formula can become quite large even if the final result is small; the | 3189 | formula 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 |
| 3477 | of the above | 3470 | of the above |
| 3478 | @texline @tmath{2\times3} | 3471 | @texline @math{2\times3} |
| 3479 | @infoline 2x3 | 3472 | @infoline 2x3 |
| 3480 | matrix to get @expr{[6, 15]}. Now use @samp{*} to sum along the columns | 3473 | matrix to get @expr{[6, 15]}. Now use @samp{*} to sum along the columns |
| 3481 | to get @expr{[5, 7, 9]}. | 3474 | to get @expr{[5, 7, 9]}. |
| @@ -3626,10 +3619,10 @@ assume the vector was a row vector in order to make the dimensions | |||
| 3626 | come out right, and the answer would be incorrect. If you | 3619 | come out right, and the answer would be incorrect. If you |
| 3627 | don't feel safe letting Calc take either interpretation of your | 3620 | don't feel safe letting Calc take either interpretation of your |
| 3628 | vectors, use explicit | 3621 | vectors, use explicit |
| 3629 | @texline @tmath{N\times1} | 3622 | @texline @math{N\times1} |
| 3630 | @infoline Nx1 | 3623 | @infoline Nx1 |
| 3631 | or | 3624 | or |
| 3632 | @texline @tmath{1\times N} | 3625 | @texline @math{1\times N} |
| 3633 | @infoline 1xN | 3626 | @infoline 1xN |
| 3634 | matrices instead. In this case, you would enter the original column | 3627 | matrices instead. In this case, you would enter the original column |
| 3635 | vector as @samp{[[6], [2], [3]]} or @samp{[6; 2; 3]}. | 3628 | vector 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 |
| 3680 | Now | 3673 | Now |
| 3681 | @texline @tmath{A^T A} | 3674 | @texline @math{A^T A} |
| 3682 | @infoline @expr{trn(A)*A} | 3675 | @infoline @expr{trn(A)*A} |
| 3683 | is a square matrix so a solution is possible. It turns out that the | 3676 | is 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 |
| 3776 | from | 3769 | from |
| 3777 | @texline @tmath{2^{-4}} | 3770 | @texline @math{2^{-4}} |
| 3778 | @infoline @expr{2^-4} | 3771 | @infoline @expr{2^-4} |
| 3779 | to @expr{2^4}. @xref{List Answer 1, 1}. (@bullet{}) | 3772 | to @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 |
| 3980 | where | 3973 | where |
| 3981 | @texline @tmath{\sum x} | 3974 | @texline @math{\sum x} |
| 3982 | @infoline @expr{sum(x)} | 3975 | @infoline @expr{sum(x)} |
| 3983 | represents the sum of all the values of @expr{x}. While there is an | 3976 | represents the sum of all the values of @expr{x}. While there is an |
| 3984 | actual @code{sum} function in Calc, it's easier to sum a vector using a | 3977 | actual @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 | ||
| 4085 | Let's ``plot'' this straight line approximation, | 4078 | Let'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}, |
| 4088 | and compare it with the original data. | 4081 | and 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} |
| 4341 | function @samp{besJ(1,x)} for @expr{x} from 0 to 5 in steps of 0.25. | 4334 | function @samp{besJ(1,x)} for @expr{x} from 0 to 5 in steps of 0.25. |
| 4342 | Find the value of @expr{x} (from among the above set of values) for | 4335 | Find 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} |
| 4353 | for @expr{m=12} (i.e., an integer of less than | 4346 | for @expr{m=12} (i.e., an integer of less than |
| 4354 | twelve digits). Convert this integer into a vector of @expr{m} | 4347 | twelve 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 |
| 4366 | is @cpi{}. The area of the | 4359 | is @cpi{}. The area of the |
| 4367 | @texline @tmath{2\times2} | 4360 | @texline @math{2\times2} |
| 4368 | @infoline 2x2 | 4361 | @infoline 2x2 |
| 4369 | square that encloses that circle is 4. So if we throw @var{n} darts at | 4362 | square that encloses that circle is 4. So if we throw @var{n} darts at |
| 4370 | random points in the square, about @cpiover{4} of them will land inside | 4363 | random points in the square, about @cpiover{4} of them will land inside |
| 4371 | the circle. This gives us an entertaining way to estimate the value of | 4364 | the 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}} |
| 4373 | command picks a random number between zero and the value on the stack. | 4366 | command picks a random number between zero and the value on the stack. |
| 4374 | We could get a random floating-point number between @i{-1} and 1 by typing | 4367 | We 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 |
| 4376 | this square, then use vector mapping and reduction to count how many | 4369 | this square, then use vector mapping and reduction to count how many |
| 4377 | points lie inside the unit circle. Hint: Use the @kbd{v b} command. | 4370 | points 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 | |||
| 4383 | of vertical lines with a spacing of one inch. Toss a one-inch matchstick | 4376 | of vertical lines with a spacing of one inch. Toss a one-inch matchstick |
| 4384 | onto the field. The probability that the matchstick will land crossing | 4377 | onto the field. The probability that the matchstick will land crossing |
| 4385 | a line turns out to be | 4378 | a 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}. |
| 4388 | Toss 100 matchsticks to estimate @cpi{}. (If you want still more fun, | 4381 | Toss 100 matchsticks to estimate @cpi{}. (If you want still more fun, |
| 4389 | the probability that the GCD (@w{@kbd{k g}}) of two large integers is | 4382 | the probability that the GCD (@w{@kbd{k g}}) of two large integers is |
| 4390 | one turns out to be | 4383 | one 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}. |
| 4393 | That provides yet another way to estimate @cpi{}.) | 4386 | That 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 | |||
| 4418 | function you give to the starting value 0, 1, 2, up to @var{n} times | 4411 | function you give to the starting value 0, 1, 2, up to @var{n} times |
| 4419 | and returns a vector of the results. Use this command to create a | 4412 | and 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 |
| 4422 | in both @expr{x} and @expr{y}; then take another step, and so on. Use the | 4415 | in 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 |
| 4424 | walk to walk a unit distance, but in a random direction, at each step. | 4417 | walk 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 |
| 4500 | The square root of @i{-9} is by default rendered in rectangular form | 4493 | The 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 |
| 4502 | phase angle of 90 degrees). All the usual arithmetic and scientific | 4495 | phase angle of 90 degrees). All the usual arithmetic and scientific |
| 4503 | operations are defined on both types of complex numbers. | 4496 | operations are defined on both types of complex numbers. |
| @@ -4522,14 +4515,14 @@ algebraic entry. | |||
| 4522 | 4515 | ||
| 4523 | @noindent | 4516 | @noindent |
| 4524 | Since infinity is infinitely large, multiplying it by any finite | 4517 | Since infinity is infinitely large, multiplying it by any finite |
| 4525 | number (like @i{-17}) has no effect, except that since @i{-17} | 4518 | number (like @mathit{-17}) has no effect, except that since @mathit{-17} |
| 4526 | is negative, it changes a plus infinity to a minus infinity. | 4519 | is 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 |
| 4528 | negative number.'') Adding any finite number to infinity also | 4521 | negative number.'') Adding any finite number to infinity also |
| 4529 | leaves it unchanged. Taking an absolute value gives us plus | 4522 | leaves it unchanged. Taking an absolute value gives us plus |
| 4530 | infinity again. Finally, we add this plus infinity to the minus | 4523 | infinity again. Finally, we add this plus infinity to the minus |
| 4531 | infinity we had earlier. If you work it out, you might expect | 4524 | infinity we had earlier. If you work it out, you might expect |
| 4532 | the answer to be @i{-72} for this. But the 72 has been completely | 4525 | the answer to be @mathit{-72} for this. But the 72 has been completely |
| 4533 | lost next to the infinities; by the time we compute @w{@samp{inf - inf}} | 4526 | lost next to the infinities; by the time we compute @w{@samp{inf - inf}} |
| 4534 | the finite difference between them, if any, is undetectable. | 4527 | the finite difference between them, if any, is undetectable. |
| 4535 | So we say the result is @dfn{indeterminate}, which Calc writes | 4528 | So 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 | ||
| 4538 | Dividing by zero is normally treated as an error, but you can get | 4531 | Dividing by zero is normally treated as an error, but you can get |
| 4539 | Calc to write an answer in terms of infinity by pressing @kbd{m i} | 4532 | Calc to write an answer in terms of infinity by pressing @kbd{m i} |
| 4540 | to turn on ``infinite mode.'' | 4533 | to 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}} |
| 4691 | where @expr{R} is the radius of the circle that | 4684 | where @expr{R} is the radius of the circle that |
| 4692 | defines the center of the tube and @expr{r} is the radius of the tube | 4685 | defines 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 |
| 4767 | In this last step, Calc has found a new number which, when multiplied | 4760 | In this last step, Calc has divided by 5 modulo 24; i.e., it has found a |
| 4768 | by 5 modulo 24, produces the original number, 21. If @var{m} is prime | 4761 | new number which, when multiplied by 5 modulo 24, produces the original |
| 4769 | it is always possible to find such a number. For non-prime @var{m} | 4762 | number, 21. If @var{m} is prime and the divisor is not a multiple of |
| 4770 | like 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 |
| 4788 | says that | 4782 | says 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} |
| 4791 | if @expr{n} is a prime number and @expr{x} is an integer less than | 4785 | if @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 |
| 4816 | is about | 4810 | is 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}} |
| 4819 | seconds. What time will it be that many seconds from right now? | 4813 | seconds. 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 |
| 4970 | If you enter a formula in algebraic mode that refers to variables, | 4964 | If you enter a formula in Algebraic mode that refers to variables, |
| 4971 | the formula itself is pushed onto the stack. You can manipulate | 4965 | the formula itself is pushed onto the stack. You can manipulate |
| 4972 | formulas as regular data objects. | 4966 | formulas 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 |
| 5123 | Calc has invented the variable @samp{s1} to represent an unknown sign; | 5117 | Calc has invented the variable @samp{s1} to represent an unknown sign; |
| 5124 | it is supposed to be either @i{+1} or @i{-1}. Here we have used | 5118 | it is supposed to be either @mathit{+1} or @mathit{-1}. Here we have used |
| 5125 | the ``let'' command to evaluate the expression when the sign is negative. | 5119 | the ``let'' command to evaluate the expression when the sign is negative. |
| 5126 | If we plugged this into our second derivative we would get the same, | 5120 | If we plugged this into our second derivative we would get the same, |
| 5127 | negative, answer, so @expr{x = -1.19023} is also a maximum. | 5121 | negative, answer, so @expr{x = -1.19023} is also a maximum. |
| @@ -5188,7 +5182,7 @@ polynomial? (The answer will be unique to within a constant | |||
| 5188 | multiple; choose the solution where the leading coefficient is one.) | 5182 | multiple; 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 | ||
| 5191 | The @kbd{m s} command enables ``symbolic mode,'' in which formulas | 5185 | The @kbd{m s} command enables Symbolic mode, in which formulas |
| 5192 | like @samp{sqrt(5)} that can't be evaluated exactly are left in | 5186 | like @samp{sqrt(5)} that can't be evaluated exactly are left in |
| 5193 | symbolic form rather than giving a floating-point approximate answer. | 5187 | symbolic form rather than giving a floating-point approximate answer. |
| 5194 | Fraction mode (@kbd{m f}) is also useful when doing algebra. | 5188 | Fraction 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 | ||
| 5206 | One more mode that makes reading formulas easier is ``Big mode.'' | 5200 | One 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} |
| 5293 | of | 5287 | of |
| 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 |
| 5297 | integral for integers @expr{y} from 1 to 5. @xref{Algebra Answer 3, | 5291 | integral 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, | |||
| 5300 | Calc's integrator can do many simple integrals symbolically, but many | 5294 | Calc's integrator can do many simple integrals symbolically, but many |
| 5301 | others are beyond its capabilities. Suppose we wish to find the area | 5295 | others are beyond its capabilities. Suppose we wish to find the area |
| 5302 | under the curve | 5296 | under 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)} |
| 5305 | over the same range of @expr{x}. If you entered this formula and typed | 5299 | over 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 |
| 5354 | to radians mode?) | 5348 | to Radians mode?) |
| 5355 | 5349 | ||
| 5356 | Here we have divided the curve into ten segments of equal width; | 5350 | Here we have divided the curve into ten segments of equal width; |
| 5357 | approximating these segments as rectangular boxes (i.e., assuming | 5351 | approximating 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 | ||
| 5444 | Compute the integral from 1 to 2 of | 5438 | Compute 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)} |
| 5447 | using Simpson's rule with 10 slices. | 5441 | using 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 | |||
| 5607 | another good reason to store your rules in variables rather than | 5601 | another good reason to store your rules in variables rather than |
| 5608 | entering them on the fly. | 5602 | entering 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 |
| 5611 | mode, then enter the formula @samp{@w{(2 + sqrt(2))} / @w{(1 + sqrt(2))}}. | 5605 | mode, then enter the formula @samp{@w{(2 + sqrt(2))} / @w{(1 + sqrt(2))}}. |
| 5612 | Using a rewrite rule, simplify this formula by multiplying both | 5606 | Using a rewrite rule, simplify this formula by multiplying both |
| 5613 | sides by the conjugate @w{@samp{1 - sqrt(2)}}. The result will have | 5607 | sides 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} |
| 5869 | to be ``indeterminate,'' and leaves it unevaluated (assuming infinite | 5863 | to be ``indeterminate,'' and leaves it unevaluated (assuming Infinite |
| 5870 | mode is not enabled). Some people prefer to define @expr{0^0 = 1}, | 5864 | mode is not enabled). Some people prefer to define @expr{0^0 = 1}, |
| 5871 | so that the identity @expr{x^0 = 1} can safely be used for all @expr{x}. | 5865 | so that the identity @expr{x^0 = 1} can safely be used for all @expr{x}. |
| 5872 | Find a way to make Calc follow this convention. What happens if you | 5866 | Find a way to make Calc follow this convention. What happens if you |
| 5873 | now type @kbd{m i} to turn on infinite mode? | 5867 | now 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)} |
| 5993 | is defined as the integral of @samp{sin(t)/t} for | 5987 | is 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 |
| 6068 | Compute | 6062 | Compute |
| 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}, |
| 6071 | where @expr{x} is the number on the top of the stack. | 6065 | where @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 |
| 6133 | A fascinating property of the Fibonacci numbers is that the @expr{n}th | 6127 | A fascinating property of the Fibonacci numbers is that the @expr{n}th |
| 6134 | Fibonacci number can be found directly by computing | 6128 | Fibonacci 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)} |
| 6137 | and then rounding to the nearest integer, where | 6131 | and 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}, |
| 6140 | the ``golden ratio,'' is | 6134 | the ``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} |
| 6144 | variable, or the @kbd{I H P} command.) | 6138 | variable, 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} |
| 6157 | representation of | 6151 | representation of |
| 6158 | @texline @tmath{\phi} | 6152 | @texline @math{\phi} |
| 6159 | @infoline @expr{phi} | 6153 | @infoline @expr{phi} |
| 6160 | is | 6154 | is |
| 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/( ...@: )))}. |
| 6163 | We can compute an approximate value by carrying this however far | 6157 | We can compute an approximate value by carrying this however far |
| 6164 | and then replacing the innermost | 6158 | and then replacing the innermost |
| 6165 | @texline @tmath{1/( \ldots )} | 6159 | @texline @math{1/( \ldots )} |
| 6166 | @infoline @expr{1/( ...@: )} | 6160 | @infoline @expr{1/( ...@: )} |
| 6167 | by 1. Approximate | 6161 | by 1. Approximate |
| 6168 | @texline @tmath{\phi} | 6162 | @texline @math{\phi} |
| 6169 | @infoline @expr{phi} | 6163 | @infoline @expr{phi} |
| 6170 | using a twenty-term continued fraction. | 6164 | using 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 | |||
| 6265 | property that all of the odd Bernoulli numbers are zero, and the | 6259 | property that all of the odd Bernoulli numbers are zero, and the |
| 6266 | even ones, while difficult to compute, can be roughly approximated | 6260 | even ones, while difficult to compute, can be roughly approximated |
| 6267 | by the formula | 6261 | by 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}. |
| 6270 | Let's write a keyboard macro to compute (approximate) Bernoulli numbers. | 6264 | Let'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 |
| 6440 | where @expr{f'(x)} is the derivative of @expr{f}. The @expr{x} | 6434 | where @expr{f'(x)} is the derivative of @expr{f}. The @expr{x} |
| 6441 | values will quickly converge to a solution, i.e., eventually | 6435 | values 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} |
| 6444 | and @expr{x} will be equal to within the limits | 6438 | and @expr{x} will be equal to within the limits |
| 6445 | of the current precision. Write a program which takes a formula | 6439 | of the current precision. Write a program which takes a formula |
| 6446 | involving the variable @expr{x}, and an initial guess @expr{x_0}, | 6440 | involving the variable @expr{x}, and an initial guess @expr{x_0}, |
| 6447 | on the stack, and produces a value of @expr{x} for which the formula | 6441 | on the stack, and produces a value of @expr{x} for which the formula |
| 6448 | is zero. Use it to find a solution of | 6442 | is 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} |
| 6451 | near @expr{x = 4.5}. (Use angles measured in radians.) Note that | 6445 | near @expr{x = 4.5}. (Use angles measured in radians.) Note that |
| 6452 | the built-in @w{@kbd{a R}} (@code{calc-find-root}) command uses Newton's | 6446 | the 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)} |
| 6461 | is defined as the derivative of | 6455 | is 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))}. |
| 6464 | For large values of @expr{z}, it can be approximated by the infinite sum | 6458 | For 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 |
| 6480 | where | 6474 | where |
| 6481 | @texline @tmath{\sum} | 6475 | @texline @math{\sum} |
| 6482 | @infoline @expr{sum} | 6476 | @infoline @expr{sum} |
| 6483 | represents the sum over @expr{n} from 1 to infinity | 6477 | represents 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. | |||
| 6486 | While this sum is not guaranteed to converge, in practice it is safe. | 6480 | While this sum is not guaranteed to converge, in practice it is safe. |
| 6487 | An interesting mathematical constant is Euler's gamma, which is equal | 6481 | An interesting mathematical constant is Euler's gamma, which is equal |
| 6488 | to about 0.5772. One way to compute it is by the formula, | 6482 | to 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)}. |
| 6491 | Unfortunately, 1 isn't a large enough argument | 6485 | Unfortunately, 1 isn't a large enough argument |
| 6492 | for the above formula to work (5 is a much safer value for @expr{z}). | 6486 | for the above formula to work (5 is a much safer value for @expr{z}). |
| 6493 | Fortunately, we can compute | 6487 | Fortunately, we can compute |
| 6494 | @texline @tmath{\psi(1)} | 6488 | @texline @math{\psi(1)} |
| 6495 | @infoline @expr{psi(1)} | 6489 | @infoline @expr{psi(1)} |
| 6496 | from | 6490 | from |
| 6497 | @texline @tmath{\psi(5)} | 6491 | @texline @math{\psi(5)} |
| 6498 | @infoline @expr{psi(5)} | 6492 | @infoline @expr{psi(5)} |
| 6499 | using the recurrence | 6493 | using 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}. |
| 6502 | Your task: Develop a program to compute | 6496 | Your 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)}; |
| 6505 | it should ``pump up'' @expr{z} | 6499 | it should ``pump up'' @expr{z} |
| 6506 | if necessary to be greater than 5, then use the above summation | 6500 | if necessary to be greater than 5, then use the above summation |
| 6507 | formula. Use looping commands to compute the sum. Use your function | 6501 | formula. Use looping commands to compute the sum. Use your function |
| 6508 | to compute | 6502 | to compute |
| 6509 | @texline @tmath{\gamma} | 6503 | @texline @math{\gamma} |
| 6510 | @infoline @expr{gamma} | 6504 | @infoline @expr{gamma} |
| 6511 | to twelve decimal places. (Calc has a built-in command | 6505 | to twelve decimal places. (Calc has a built-in command |
| 6512 | for Euler's constant, @kbd{I P}, which you can use to check your answer.) | 6506 | for 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 | ||
| 6685 | The result is | 6679 | The 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 | ||
| 6696 | After computing the intermediate term | 6690 | After 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}, |
| 6699 | you can leave that result on the stack while you compute the second | 6693 | you can leave that result on the stack while you compute the second |
| 6700 | term. With both of these results waiting on the stack you can then | 6694 | term. 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 | |||
| 6845 | times anything is zero.'' | 6839 | times anything is zero.'' |
| 6846 | 6840 | ||
| 6847 | @c [fix-ref Infinities] | 6841 | @c [fix-ref Infinities] |
| 6848 | The @kbd{m i} command enables an @dfn{infinite mode} in which @expr{1 / 0} | 6842 | The @kbd{m i} command enables an @dfn{Infinite mode} in which @expr{1 / 0} |
| 6849 | results in a special symbol that represents ``infinity.'' If you | 6843 | results in a special symbol that represents ``infinity.'' If you |
| 6850 | multiply infinity by zero, Calc uses another special new symbol to | 6844 | multiply infinity by zero, Calc uses another special new symbol to |
| 6851 | show that the answer is ``indeterminate.'' @xref{Infinities}, for | 6845 | show that the answer is ``indeterminate.'' @xref{Infinities}, for |
| @@ -7003,13 +6997,13 @@ give a floating-point result that is inaccurate even when rounded | |||
| 7003 | down to an integer. Consider @expr{123456789 / 2} when the current | 6997 | down to an integer. Consider @expr{123456789 / 2} when the current |
| 7004 | precision is 6 digits. The true answer is @expr{61728394.5}, but | 6998 | precision is 6 digits. The true answer is @expr{61728394.5}, but |
| 7005 | with a precision of 6 this will be rounded to | 6999 | with 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.}. |
| 7008 | The result, when converted to an integer, will be off by 106. | 7002 | The result, when converted to an integer, will be off by 106. |
| 7009 | 7003 | ||
| 7010 | Here are two solutions: Raise the precision enough that the | 7004 | Here are two solutions: Raise the precision enough that the |
| 7011 | floating-point round-off error is strictly to the right of the | 7005 | floating-point round-off error is strictly to the right of the |
| 7012 | decimal point. Or, convert to fraction mode so that @expr{123456789 / 2} | 7006 | decimal point. Or, convert to Fraction mode so that @expr{123456789 / 2} |
| 7013 | produces the exact fraction @expr{123456789:2}, which can be rounded | 7007 | produces the exact fraction @expr{123456789:2}, which can be rounded |
| 7014 | down by the @kbd{F} command without ever switching to floating-point | 7008 | down by the @kbd{F} command without ever switching to floating-point |
| 7015 | format. | 7009 | format. |
| @@ -7022,9 +7016,9 @@ format. | |||
| 7022 | does a floating-point calculation instead and produces @expr{1.5}. | 7016 | does a floating-point calculation instead and produces @expr{1.5}. |
| 7023 | 7017 | ||
| 7024 | Calc will find an exact result for a logarithm if the result is an integer | 7018 | Calc will find an exact result for a logarithm if the result is an integer |
| 7025 | or the reciprocal of an integer. But there is no efficient way to search | 7019 | or (when in Fraction mode) the reciprocal of an integer. But there is |
| 7026 | the space of all possible rational numbers for an exact answer, so Calc | 7020 | no efficient way to search the space of all possible rational numbers |
| 7027 | doesn't try. | 7021 | for 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 | ||
| 7099 | This can be made more readable using @kbd{d B} to enable ``big'' display | 7093 | This can be made more readable using @kbd{d B} to enable Big display |
| 7100 | mode: | 7094 | mode: |
| 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 | ||
| 7110 | Type @kbd{d N} to return to ``normal'' display mode afterwards. | 7104 | Type @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 |
| 7116 | To solve | 7110 | To 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}, |
| 7119 | first we compute | 7113 | first 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} |
| 7122 | and | 7116 | and |
| 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}; |
| 7125 | now, we have a system | 7119 | now, 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} |
| 7128 | which we can solve using Calc's @samp{/} command. | 7122 | which we can solve using Calc's @samp{/} command. |
| 7129 | 7123 | ||
| @@ -7155,7 +7149,7 @@ $$ | |||
| 7155 | 7149 | ||
| 7156 | The first step is to enter the coefficient matrix. We'll store it in | 7150 | The first step is to enter the coefficient matrix. We'll store it in |
| 7157 | quick variable number 7 for later reference. Next, we compute the | 7151 | quick 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} |
| 7160 | vector. | 7154 | vector. |
| 7161 | 7155 | ||
| @@ -7173,7 +7167,7 @@ vector. | |||
| 7173 | 7167 | ||
| 7174 | @noindent | 7168 | @noindent |
| 7175 | Now we compute the matrix | 7169 | Now we compute the matrix |
| 7176 | @texline @tmath{A'} | 7170 | @texline @math{A'} |
| 7177 | @infoline @expr{A2} | 7171 | @infoline @expr{A2} |
| 7178 | and divide. | 7172 | and divide. |
| 7179 | 7173 | ||
| @@ -7194,16 +7188,16 @@ and divide. | |||
| 7194 | round-off error.) | 7188 | round-off error.) |
| 7195 | 7189 | ||
| 7196 | Notice that the answers are similar to those for the | 7190 | Notice 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 |
| 7199 | system solved in the text. That's because the fourth equation that was | 7193 | system solved in the text. That's because the fourth equation that was |
| 7200 | added to the system is almost identical to the first one multiplied | 7194 | added to the system is almost identical to the first one multiplied |
| 7201 | by two. (If it were identical, we would have gotten the exact same | 7195 | by two. (If it were identical, we would have gotten the exact same |
| 7202 | answer since the | 7196 | answer since the |
| 7203 | @texline @tmath{4\times3} | 7197 | @texline @math{4\times3} |
| 7204 | @infoline 4x3 | 7198 | @infoline 4x3 |
| 7205 | system would be equivalent to the original | 7199 | system would be equivalent to the original |
| 7206 | @texline @tmath{3\times3} | 7200 | @texline @math{3\times3} |
| 7207 | @infoline 3x3 | 7201 | @infoline 3x3 |
| 7208 | system.) | 7202 | system.) |
| 7209 | 7203 | ||
| @@ -7280,7 +7274,7 @@ $$ m \times x + b \times 1 = y $$ | |||
| 7280 | @end tex | 7274 | @end tex |
| 7281 | 7275 | ||
| 7282 | Thus we want a | 7276 | Thus we want a |
| 7283 | @texline @tmath{19\times2} | 7277 | @texline @math{19\times2} |
| 7284 | @infoline 19x2 | 7278 | @infoline 19x2 |
| 7285 | matrix with our @expr{x} vector as one column and | 7279 | matrix with our @expr{x} vector as one column and |
| 7286 | ones as the other column. So, first we build the column of ones, then | 7280 | ones 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 |
| 7301 | Now we compute | 7295 | Now 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} |
| 7304 | and | 7298 | and |
| 7305 | @texline @tmath{A^T A} | 7299 | @texline @math{A^T A} |
| 7306 | @infoline @expr{trn(A) * A} | 7300 | @infoline @expr{trn(A) * A} |
| 7307 | and divide. | 7301 | and divide. |
| 7308 | 7302 | ||
| @@ -7330,7 +7324,7 @@ and divide. | |||
| 7330 | @end smallexample | 7324 | @end smallexample |
| 7331 | 7325 | ||
| 7332 | Since we were solving equations of the form | 7326 | Since 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}, |
| 7335 | these numbers should be @expr{m} and @expr{b}, respectively. Sure | 7329 | these numbers should be @expr{m} and @expr{b}, respectively. Sure |
| 7336 | enough, they agree exactly with the result computed using @kbd{V M} and | 7330 | enough, 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 |
| 7395 | A number @expr{j} is a divisor of @expr{n} if | 7389 | A 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}. |
| 7398 | The first step is to get a vector that identifies the divisors. | 7392 | The 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 | |||
| 7464 | the job is pretty straightforward. | 7458 | the job is pretty straightforward. |
| 7465 | 7459 | ||
| 7466 | Incidentally, Calc provides the | 7460 | Incidentally, 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} |
| 7469 | function which is zero if and only if its argument is square-free. It | 7463 | function which is zero if and only if its argument is square-free. It |
| 7470 | would be a much more convenient way to do the above test in practice. | 7464 | would 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 | |||
| 7498 | the ``triangular numbers'' (now you know why!). The @expr{n}th | 7492 | the ``triangular numbers'' (now you know why!). The @expr{n}th |
| 7499 | triangular number is the sum of the integers from 1 to @expr{n}, and | 7493 | triangular number is the sum of the integers from 1 to @expr{n}, and |
| 7500 | can be computed directly by the formula | 7494 | can 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 |
| 7595 | It's a good idea to verify, as in the last step above, that only | 7589 | It's a good idea to verify, as in the last step above, that only |
| 7596 | one value is equal to the maximum. (After all, a plot of | 7590 | one 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)} |
| 7599 | might have many points all equal to the maximum value, 1.) | 7593 | might 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 | |||
| 7866 | symmetries. First of all, after some thought it's clear that the | 7860 | symmetries. 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} |
| 7868 | component for one end of the match, pick a random direction | 7862 | component 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}, |
| 7871 | and see if @expr{x} and | 7865 | and 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. |
| 7875 | The lines are at integer coordinates, so this happens when the two | 7869 | The 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 | |||
| 7886 | endpoint. The rightmost endpoint will be between 0 and 1 if the | 7880 | endpoint. The rightmost endpoint will be between 0 and 1 if the |
| 7887 | match does not cross a line, or between 1 and 2 if it does. So: | 7881 | match does not cross a line, or between 1 and 2 if it does. So: |
| 7888 | Pick random @expr{x} and | 7882 | Pick random @expr{x} and |
| 7889 | @texline @tmath{\theta}, | 7883 | @texline @math{\theta}, |
| 7890 | @infoline @expr{theta}, | 7884 | @infoline @expr{theta}, |
| 7891 | compute | 7885 | compute |
| 7892 | @texline @tmath{x + \cos \theta}, | 7886 | @texline @math{x + \cos \theta}, |
| 7893 | @infoline @expr{x + cos(theta)}, | 7887 | @infoline @expr{x + cos(theta)}, |
| 7894 | and count how many of the results are greater than one. Simple! | 7888 | and 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 |
| 8215 | Aha! It's unlikely that an irrational number would equal a fraction | 8209 | Aha! It's unlikely that an irrational number would equal a fraction |
| 8216 | this simple to within ten digits, so our original number was probably | 8210 | this 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 | ||
| 8220 | Notice that we didn't need to re-round the number when we reduced the | 8214 | Notice 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 |
| 8256 | input. As in the @expr{1 / 0} case, Calc will only use infinities | 8250 | input. As in the @expr{1 / 0} case, Calc will only use infinities |
| 8257 | here if you have turned on ``infinite'' mode. Otherwise, it will | 8251 | here if you have turned on Infinite mode. Otherwise, it will |
| 8258 | treat @samp{ln(0)} as an error. | 8252 | treat @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 |
| 8469 | is now a member of the interval. So Calc leaves this one unevaluated, too. | 8463 | is now a member of the interval. So Calc leaves this one unevaluated, too. |
| 8470 | 8464 | ||
| 8471 | If you turn on ``infinite'' mode by pressing @kbd{m i}, you will | 8465 | If you turn on Infinite mode by pressing @kbd{m i}, you will |
| 8472 | instead get the answer @samp{[0.1 .. inf]}, which includes infinity | 8466 | instead get the answer @samp{[0.1 .. inf]}, which includes infinity |
| 8473 | as a possible value. | 8467 | as a possible value. |
| 8474 | 8468 | ||
| 8475 | The fourth calculation, @samp{1 / (-10 .. 10)}, has the same problem. | 8469 | The fourth calculation, @samp{1 / (-10 .. 10)}, has the same problem. |
| 8476 | Zero is buried inside the interval, but it's still a possible value. | 8470 | Zero is buried inside the interval, but it's still a possible value. |
| 8477 | It's not hard to see that the actual result of @samp{1 / (-10 .. 10)} | 8471 | It's not hard to see that the actual result of @samp{1 / (-10 .. 10)} |
| 8478 | will be either greater than @i{0.1}, or less than @i{-0.1}. Thus | 8472 | will be either greater than @mathit{0.1}, or less than @mathit{-0.1}. Thus |
| 8479 | the interval goes from minus infinity to plus infinity, with a ``hole'' | 8473 | the interval goes from minus infinity to plus infinity, with a ``hole'' |
| 8480 | in it from @i{-0.1} to @i{0.1}. Calc doesn't have any way to | 8474 | in it from @mathit{-0.1} to @mathit{0.1}. Calc doesn't have any way to |
| 8481 | represent this, so it just reports @samp{[-inf .. inf]} as the answer. | 8475 | represent this, so it just reports @samp{[-inf .. inf]} as the answer. |
| 8482 | It may be disappointing to hear ``the answer lies somewhere between | 8476 | It may be disappointing to hear ``the answer lies somewhere between |
| 8483 | minus infinity and plus infinity, inclusive,'' but that's the best | 8477 | minus 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 |
| 8500 | In the first case the result says, ``if a number is between @i{-3} and | 8494 | In the first case the result says, ``if a number is between @mathit{-3} and |
| 8501 | 3, its square is between 0 and 9.'' The second case says, ``the product | 8495 | 3, its square is between 0 and 9.'' The second case says, ``the product |
| 8502 | of two numbers each between @i{-3} and 3 is between @i{-9} and 9.'' | 8496 | of two numbers each between @mathit{-3} and 3 is between @mathit{-9} and 9.'' |
| 8503 | 8497 | ||
| 8504 | An interval form is not a number; it is a symbol that can stand for | 8498 | An interval form is not a number; it is a symbol that can stand for |
| 8505 | many different numbers. Two identical-looking interval forms can stand | 8499 | many 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 | ||
| 9134 | Perhaps more surprisingly, this rule still works with infinite mode | 9128 | Perhaps more surprisingly, this rule still works with Infinite mode |
| 9135 | turned on. Calc tries @code{EvalRules} before any built-in rules for | 9129 | turned on. Calc tries @code{EvalRules} before any built-in rules for |
| 9136 | a function. This allows you to override the default behavior of any | 9130 | a function. This allows you to override the default behavior of any |
| 9137 | Calc feature: Even though Calc now wants to evaluate @expr{0^0} to | 9131 | Calc 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 |
| 9257 | Computing | 9251 | Computing |
| 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 | ||
| 9261 | Using the stack: @kbd{C-x ( @key{RET} S @key{TAB} / C-x )}. | 9255 | Using 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 |
| 9327 | This program is quite efficient because Calc knows how to raise a | 9321 | This program is quite efficient because Calc knows how to raise a |
| 9328 | matrix (or other value) to the power @expr{n} in only | 9322 | matrix (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)} |
| 9331 | steps. For example, this program can compute the 1000th Fibonacci | 9325 | steps. For example, this program can compute the 1000th Fibonacci |
| 9332 | number (a 209-digit integer!) in about 10 steps; even though the | 9326 | number (a 209-digit integer!) in about 10 steps; even though the |
| @@ -9380,7 +9374,7 @@ harmonic number is 4.02. | |||
| 9380 | @noindent | 9374 | @noindent |
| 9381 | The first step is to compute the derivative @expr{f'(x)} and thus | 9375 | The first step is to compute the derivative @expr{f'(x)} and thus |
| 9382 | the formula | 9376 | the 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. | |||
| 9497 | The first step is to adjust @expr{z} to be greater than 5. A simple | 9491 | The 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 |
| 9499 | reduce the problem using | 9493 | reduce 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 |
| 9502 | on to compute | 9496 | on 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)}, |
| 9505 | and remember to add back a factor of @expr{-1/z} when we're done. This | 9499 | and remember to add back a factor of @expr{-1/z} when we're done. This |
| 9506 | step is repeated until @expr{z > 5}. | 9500 | step 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 | ||
| 9543 | Now we compute the initial part of the sum: | 9537 | Now 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} |
| 9546 | minus the adjustment factor. | 9540 | minus 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 | ||
| 9586 | This is the value of | 9580 | This is the value of |
| 9587 | @texline @tmath{-\gamma}, | 9581 | @texline @math{-\gamma}, |
| 9588 | @infoline @expr{- gamma}, | 9582 | @infoline @expr{- gamma}, |
| 9589 | with a slight bit of roundoff error. To get a full 12 digits, let's use | 9583 | with a slight bit of roundoff error. To get a full 12 digits, let's use |
| 9590 | a higher precision: | 9584 | a higher precision: |
| @@ -9619,7 +9613,7 @@ C-x ) | |||
| 9619 | @noindent | 9613 | @noindent |
| 9620 | Taking the derivative of a term of the form @expr{x^n} will produce | 9614 | Taking the derivative of a term of the form @expr{x^n} will produce |
| 9621 | a term like | 9615 | a 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)}. |
| 9624 | Taking the derivative of a constant | 9618 | Taking the derivative of a constant |
| 9625 | produces zero. From this it is easy to see that the @expr{n}th | 9619 | produces 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*} | |||
| 9896 | and @samp{*Calc Trail*}. The former displays the contents of the | 9890 | and @samp{*Calc Trail*}. The former displays the contents of the |
| 9897 | Calculator stack and is manipulated exclusively through Calc commands. | 9891 | Calculator stack and is manipulated exclusively through Calc commands. |
| 9898 | It is possible (though not usually necessary) to create several Calc | 9892 | It is possible (though not usually necessary) to create several Calc |
| 9899 | Mode buffers each of which has an independent stack, undo list, and | 9893 | mode buffers each of which has an independent stack, undo list, and |
| 9900 | mode settings. There is exactly one Calc Trail buffer; it records a | 9894 | mode settings. There is exactly one Calc Trail buffer; it records a |
| 9901 | list of the results of all calculations that have been done. The | 9895 | list of the results of all calculations that have been done. The |
| 9902 | Calc Trail buffer uses a variant of Calc Mode, so Calculator commands | 9896 | Calc Trail buffer uses a variant of Calc mode, so Calculator commands |
| 9903 | still work when the trail buffer's window is selected. It is possible | 9897 | still work when the trail buffer's window is selected. It is possible |
| 9904 | to turn the trail window off, but the @samp{*Calc Trail*} buffer itself | 9898 | to turn the trail window off, but the @samp{*Calc Trail*} buffer itself |
| 9905 | still exists and is updated silently. @xref{Trail Commands}. | 9899 | still exists and is updated silently. @xref{Trail Commands}. |
| @@ -9913,7 +9907,7 @@ still exists and is updated silently. @xref{Trail Commands}. | |||
| 9913 | In most installations, the @kbd{M-# c} key sequence is a more | 9907 | In most installations, the @kbd{M-# c} key sequence is a more |
| 9914 | convenient way to start the Calculator. Also, @kbd{M-# M-#} and | 9908 | convenient 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 |
| 9916 | in its ``keypad'' mode. | 9910 | in 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 |
| 9988 | The @kbd{q} key (@code{calc-quit}) exits Calc Mode and closes the | 9982 | The @kbd{q} key (@code{calc-quit}) exits Calc mode and closes the |
| 9989 | Calculator's window(s). It does not delete the Calculator buffers. | 9983 | Calculator's window(s). It does not delete the Calculator buffers. |
| 9990 | If you type @kbd{M-x calc} again, the Calculator will reappear with the | 9984 | If you type @kbd{M-x calc} again, the Calculator will reappear with the |
| 9991 | contents of the stack intact. Typing @kbd{M-# c} or @kbd{M-# M-#} | 9985 | contents 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, |
| 10194 | and pushes the result (3) back onto the stack. This number is ready for | 10188 | and pushes the result (3) back onto the stack. This number is ready for |
| 10195 | further calculations: @kbd{5 -} pushes 5 onto the stack, then pops the | 10189 | further calculations: @kbd{5 -} pushes 5 onto the stack, then pops the |
| 10196 | 3 and 5, subtracts them, and pushes the result (@i{-2}). | 10190 | 3 and 5, subtracts them, and pushes the result (@mathit{-2}). |
| 10197 | 10191 | ||
| 10198 | Note that the ``top'' of the stack actually appears at the @emph{bottom} | 10192 | Note that the ``top'' of the stack actually appears at the @emph{bottom} |
| 10199 | of the buffer. A line containing a single @samp{.} character signifies | 10193 | of 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 | |||
| 10256 | of the number on the top of the stack or the number currently being entered. | 10250 | of the number on the top of the stack or the number currently being entered. |
| 10257 | The @kbd{_} key begins entry of a negative number or changes the sign of | 10251 | The @kbd{_} key begins entry of a negative number or changes the sign of |
| 10258 | the number currently being entered. The following sequences all enter the | 10252 | the number currently being entered. The following sequences all enter the |
| 10259 | number @i{-5} onto the stack: @kbd{0 @key{RET} 5 -}, @kbd{5 n @key{RET}}, | 10253 | number @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 | ||
| 10262 | Some other keys are active during numeric entry, such as @kbd{#} for | 10256 | Some 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}. | |||
| 10277 | Calculations can also be entered in algebraic form. This is accomplished | 10271 | Calculations can also be entered in algebraic form. This is accomplished |
| 10278 | by typing the apostrophe key, @kbd{'}, followed by the expression in | 10272 | by typing the apostrophe key, @kbd{'}, followed by the expression in |
| 10279 | standard format: @kbd{@key{'} 2+3*4 @key{RET}} computes | 10273 | standard 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} |
| 10282 | and pushes that on the stack. If you wish you can | 10276 | and pushes that on the stack. If you wish you can |
| 10283 | ignore the RPN aspect of Calc altogether and simply enter algebraic | 10277 | ignore 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 | |||
| 10285 | clear previous results off the stack. | 10279 | clear previous results off the stack. |
| 10286 | 10280 | ||
| 10287 | You can press the apostrophe key during normal numeric entry to switch | 10281 | You can press the apostrophe key during normal numeric entry to switch |
| 10288 | the half-entered number into algebraic entry mode. One reason to do this | 10282 | the half-entered number into Algebraic entry mode. One reason to do this |
| 10289 | would be to use the full Emacs cursor motion and editing keys, which are | 10283 | would be to use the full Emacs cursor motion and editing keys, which are |
| 10290 | available during algebraic entry but not during numeric entry. | 10284 | available 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 |
| 10300 | If you prefer algebraic entry, you can use the command @kbd{m a} | 10294 | If 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, |
| 10302 | digits and other keys that would normally start numeric entry instead | 10296 | digits 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 |
| 10308 | thing as @kbd{2*3+4 @key{RET}}. | 10302 | thing as @kbd{2*3+4 @key{RET}}. |
| 10309 | 10303 | ||
| 10310 | @cindex Incomplete algebraic mode | 10304 | @cindex Incomplete Algebraic Mode |
| 10311 | If you give a numeric prefix argument like @kbd{C-u} to the @kbd{m a} | 10305 | If you give a numeric prefix argument like @kbd{C-u} to the @kbd{m a} |
| 10312 | command, it enables Incomplete Algebraic mode; this is like regular | 10306 | command, it enables Incomplete Algebraic mode; this is like regular |
| 10313 | Algebraic mode except that it applies to the @kbd{(} and @kbd{[} keys | 10307 | Algebraic 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 |
| 10319 | The @kbd{m t} (@code{calc-total-algebraic-mode}) gives you an even | 10313 | The @kbd{m t} (@code{calc-total-algebraic-mode}) gives you an even |
| 10320 | stronger algebraic-entry mode, in which @emph{all} regular letter and | 10314 | stronger algebraic-entry mode, in which @emph{all} regular letter and |
| 10321 | punctuation keys begin algebraic entry. Use this if you prefer typing | 10315 | punctuation 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} | 10318 | Total Algebraic mode, hold down the @key{META} key. Thus @kbd{M-q} |
| 10325 | is the command to quit Calc, @kbd{M-p} sets the precision, and | 10319 | is 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 |
| 10327 | mode back off again. Meta keys also terminate algebraic entry, so | 10321 | mode back off again. Meta keys also terminate algebraic entry, so |
| 10328 | that @kbd{2+3 M-S} is equivalent to @kbd{2+3 @key{RET} M-S}. The symbol | 10322 | that @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 |
| 10587 | It is possible to have any number of Calc Mode buffers at once. | 10581 | It is possible to have any number of Calc mode buffers at once. |
| 10588 | Usually this is done by executing @kbd{M-x another-calc}, which | 10582 | Usually this is done by executing @kbd{M-x another-calc}, which |
| 10589 | is similar to @kbd{M-# c} except that if a @samp{*Calculator*} | 10583 | is similar to @kbd{M-# c} except that if a @samp{*Calculator*} |
| 10590 | buffer already exists, a new, independent one with a name of the | 10584 | buffer 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 | |||
| 10687 | unless you raise the precision still further. Many operations such as | 10681 | unless you raise the precision still further. Many operations such as |
| 10688 | logarithms and sines make use of similarly cached values such as | 10682 | logarithms 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)}. |
| 10692 | The visible effect of caching is that | 10686 | The visible effect of caching is that |
| 10693 | high-precision computations may seem to do extra work the first time. | 10687 | high-precision computations may seem to do extra work the first time. |
| @@ -10799,7 +10793,7 @@ The Calculator stores integers to arbitrary precision. Addition, | |||
| 10799 | subtraction, and multiplication of integers always yields an exact | 10793 | subtraction, and multiplication of integers always yields an exact |
| 10800 | integer result. (If the result of a division or exponentiation of | 10794 | integer result. (If the result of a division or exponentiation of |
| 10801 | integers is not an integer, it is expressed in fractional or | 10795 | integers is not an integer, it is expressed in fractional or |
| 10802 | floating-point form according to the current Fraction Mode. | 10796 | floating-point form according to the current Fraction mode. |
| 10803 | @xref{Fraction Mode}.) | 10797 | @xref{Fraction Mode}.) |
| 10804 | 10798 | ||
| 10805 | A decimal integer is represented as an optional sign followed by a | 10799 | A 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 | |||
| 10825 | written ``2/3'' but Calc uses the notation @samp{2:3}. (The @kbd{/} key | 10819 | written ``2/3'' but Calc uses the notation @samp{2:3}. (The @kbd{/} key |
| 10826 | performs RPN division; the following two sequences push the number | 10820 | performs 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 /} |
| 10828 | assuming Fraction Mode has been enabled.) | 10822 | assuming Fraction mode has been enabled.) |
| 10829 | When the Calculator produces a fractional result it always reduces it to | 10823 | When the Calculator produces a fractional result it always reduces it to |
| 10830 | simplest form, which may in fact be an integer. | 10824 | simplest 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 | |||
| 10846 | notation. The number of significant digits in the fractional part is | 10840 | notation. The number of significant digits in the fractional part is |
| 10847 | governed by the current floating precision (@pxref{Precision}). The | 10841 | governed by the current floating precision (@pxref{Precision}). The |
| 10848 | range of acceptable values is from | 10842 | range 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} | |||
| 10921 | notation; @pxref{Complex Formats}. | 10915 | notation; @pxref{Complex Formats}. |
| 10922 | 10916 | ||
| 10923 | Polar complex numbers are displayed in the form | 10917 | Polar 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{)}' |
| 10926 | where @var{r} is the nonnegative magnitude and | 10920 | where @var{r} is the nonnegative magnitude and |
| 10927 | @texline @tmath{\theta} | 10921 | @texline @math{\theta} |
| 10928 | @infoline @var{theta} | 10922 | @infoline @var{theta} |
| 10929 | is the argument or phase angle. The range of | 10923 | is the argument or phase angle. The range of |
| 10930 | @texline @tmath{\theta} | 10924 | @texline @math{\theta} |
| 10931 | @infoline @var{theta} | 10925 | @infoline @var{theta} |
| 10932 | depends on the current angular mode (@pxref{Angular Modes}); it is | 10926 | depends on the current angular mode (@pxref{Angular Modes}); it is |
| 10933 | generally between @i{-180} and @i{+180} degrees or the equivalent range | 10927 | generally between @mathit{-180} and @mathit{+180} degrees or the equivalent range |
| 10934 | in radians. | 10928 | in radians. |
| 10935 | 10929 | ||
| 10936 | Complex numbers are entered in stages using incomplete objects. | 10930 | Complex numbers are entered in stages using incomplete objects. |
| @@ -10939,7 +10933,7 @@ Complex numbers are entered in stages using incomplete objects. | |||
| 10939 | Operations on rectangular complex numbers yield rectangular complex | 10933 | Operations on rectangular complex numbers yield rectangular complex |
| 10940 | results, and similarly for polar complex numbers. Where the two types | 10934 | results, and similarly for polar complex numbers. Where the two types |
| 10941 | are mixed, or where new complex numbers arise (as for the square root of | 10935 | are mixed, or where new complex numbers arise (as for the square root of |
| 10942 | a negative real), the current @dfn{Polar Mode} is used to determine the | 10936 | a negative real), the current @dfn{Polar mode} is used to determine the |
| 10943 | type. @xref{Polar Mode}. | 10937 | type. @xref{Polar Mode}. |
| 10944 | 10938 | ||
| 10945 | A complex result in which the imaginary part is zero (or the phase angle | 10939 | A 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 | |||
| 10973 | that if @expr{x} got ``all the way to infinity,'' then @expr{1 / x} | 10967 | that if @expr{x} got ``all the way to infinity,'' then @expr{1 / x} |
| 10974 | would go all the way to zero. Similarly, when they say that | 10968 | would 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)} |
| 10978 | grows without bound as @expr{x} grows. The symbol @samp{-inf} likewise | 10972 | grows without bound as @expr{x} grows. The symbol @samp{-inf} likewise |
| 10979 | stands for an infinitely negative real value; for example, we say that | 10973 | stands 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 | |||
| 11027 | cannot be determined.) In Calc's notation, @samp{0 * inf = nan} | 11021 | cannot be determined.) In Calc's notation, @samp{0 * inf = nan} |
| 11028 | and @samp{inf / inf = nan}. A few other common indeterminate | 11022 | and @samp{inf / inf = nan}. A few other common indeterminate |
| 11029 | expressions are @samp{inf - inf} and @samp{inf ^ 0}. Also, | 11023 | expressions 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 | ||
| 11033 | Infinities are especially useful as parts of @dfn{intervals}. | 11027 | Infinities are especially useful as parts of @dfn{intervals}. |
| @@ -11070,7 +11064,7 @@ of its elements. | |||
| 11070 | @tindex vec | 11064 | @tindex vec |
| 11071 | Algebraic functions for building vectors include @samp{vec(a, b, c)} | 11065 | Algebraic functions for building vectors include @samp{vec(a, b, c)} |
| 11072 | to build @samp{[a, b, c]}, @samp{cvec(a, n, m)} to build an | 11066 | to 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} |
| 11075 | matrix of @samp{a}s, and @samp{index(n)} to build a vector of integers | 11069 | matrix of @samp{a}s, and @samp{index(n)} to build a vector of integers |
| 11076 | from 1 to @samp{n}. | 11070 | from 1 to @samp{n}. |
| @@ -11201,7 +11195,7 @@ The @var{mins} value is an integer or integer-valued float between 0 and 59. | |||
| 11201 | The @var{secs} value is a real number between 0 (inclusive) and 60 | 11195 | The @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 |
| 11204 | as @i{- @var{hours}} @i{-} @var{mins}/60 @i{-} @var{secs}/3600. | 11198 | as @mathit{- @var{hours}} @mathit{-} @var{mins}/60 @mathit{-} @var{secs}/3600. |
| 11205 | Display format for HMS forms is quite flexible. @xref{HMS Formats}. | 11199 | Display format for HMS forms is quite flexible. @xref{HMS Formats}. |
| 11206 | 11200 | ||
| 11207 | HMS forms can be added and subtracted. When they are added to numbers, | 11201 | HMS 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 | ||
| 11296 | Calc uses the Julian calendar for all dates before the year 1752, | 11290 | Calc uses the Julian calendar for all dates before the year 1752, |
| 11297 | including dates BC when the Julian calendar technically had not | 11291 | including dates BC when the Julian calendar technically had not |
| 11298 | yet been invented. Thus the claim that day number @i{-10000} is | 11292 | yet been invented. Thus the claim that day number @mathit{-10000} is |
| 11299 | called ``August 16, 28 BC'' should be taken with a grain of salt. | 11293 | called ``August 16, 28 BC'' should be taken with a grain of salt. |
| 11300 | 11294 | ||
| 11301 | Please note that there is no ``year 0''; the day before | 11295 | Please 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 |
| 11303 | days 0 and @i{-1} respectively in Calc's internal numbering scheme. | 11297 | days 0 and @mathit{-1} respectively in Calc's internal numbering scheme. |
| 11304 | 11298 | ||
| 11305 | @cindex Julian day counting | 11299 | @cindex Julian day counting |
| 11306 | Another day counting system in common use is, confusingly, also | 11300 | Another day counting system in common use is, confusingly, also |
| @@ -11308,7 +11302,7 @@ called ``Julian.'' It was invented in 1583 by Joseph Justus | |||
| 11308 | Scaliger, who named it in honor of his father Julius Caesar | 11302 | Scaliger, who named it in honor of his father Julius Caesar |
| 11309 | Scaliger. For obscure reasons he chose to start his day | 11303 | Scaliger. For obscure reasons he chose to start his day |
| 11310 | numbering on Jan 1, 4713 BC at noon, which in Calc's scheme | 11304 | numbering on Jan 1, 4713 BC at noon, which in Calc's scheme |
| 11311 | is @i{-1721423.5} (recall that Calc starts at midnight instead | 11305 | is @mathit{-1721423.5} (recall that Calc starts at midnight instead |
| 11312 | of noon). Thus to convert a Calc date code obtained by | 11306 | of noon). Thus to convert a Calc date code obtained by |
| 11313 | unpacking a date form into a Julian day number, simply add | 11307 | unpacking a date form into a Julian day number, simply add |
| 11314 | 1721423.5. The Julian code for @samp{6:00am Jan 9, 1991} | 11308 | 1721423.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} | |||
| 11341 | often arises in number theory. Modulo forms are written | 11335 | often arises in number theory. Modulo forms are written |
| 11342 | `@var{a} @t{mod} @var{M}', | 11336 | `@var{a} @t{mod} @var{M}', |
| 11343 | where @var{a} and @var{M} are real numbers or HMS forms, and | 11337 | where @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}}. |
| 11346 | In many applications @expr{a} and @expr{M} will be | 11340 | In many applications @expr{a} and @expr{M} will be |
| 11347 | integers but this is not required. | 11341 | integers but this is not required. |
| @@ -11373,7 +11367,7 @@ division is left in symbolic form. Other operations, such as square | |||
| 11373 | roots, are not yet supported for modulo forms. (Note that, although | 11367 | roots, 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'' |
| 11375 | in the sense of reducing | 11369 | in the sense of reducing |
| 11376 | @texline @tmath{\sqrt a} | 11370 | @texline @math{\sqrt a} |
| 11377 | @infoline @expr{sqrt(a)} | 11371 | @infoline @expr{sqrt(a)} |
| 11378 | modulo @expr{M}, this is not a useful definition from the | 11372 | modulo @expr{M}, this is not a useful definition from the |
| 11379 | number-theoretical point of view.) | 11373 | number-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 |
| 11424 | An @dfn{error form} is a number with an associated standard | 11418 | An @dfn{error form} is a number with an associated standard |
| 11425 | deviation, as in @samp{2.3 +/- 0.12}. The notation | 11419 | deviation, 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' |
| 11428 | stands for an uncertain value which follows | 11422 | stands for an uncertain value which follows |
| 11429 | a normal or Gaussian distribution of mean @expr{x} and standard | 11423 | a normal or Gaussian distribution of mean @expr{x} and standard |
| 11430 | deviation or ``error'' | 11424 | deviation or ``error'' |
| 11431 | @texline @tmath{\sigma}. | 11425 | @texline @math{\sigma}. |
| 11432 | @infoline @expr{sigma}. | 11426 | @infoline @expr{sigma}. |
| 11433 | Both the mean and the error can be either numbers or | 11427 | Both the mean and the error can be either numbers or |
| 11434 | formulas. Generally these are real numbers but the mean may also be | 11428 | formulas. Generally these are real numbers but the mean may also be |
| @@ -11439,7 +11433,7 @@ regular number by the Calculator. | |||
| 11439 | All arithmetic and transcendental functions accept error forms as input. | 11433 | All arithmetic and transcendental functions accept error forms as input. |
| 11440 | Operations on the mean-value part work just like operations on regular | 11434 | Operations on the mean-value part work just like operations on regular |
| 11441 | numbers. The error part for any function @expr{f(x)} (such as | 11435 | numbers. 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)}) |
| 11444 | is defined by the error of @expr{x} times the derivative of @expr{f} | 11438 | is defined by the error of @expr{x} times the derivative of @expr{f} |
| 11445 | evaluated at the mean value of @expr{x}. For a two-argument function | 11439 | evaluated 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 | |||
| 11470 | of standard deviations. Actual errors often are neither Gaussian-distributed | 11464 | of standard deviations. Actual errors often are neither Gaussian-distributed |
| 11471 | nor uncorrelated, and the above formulas are valid only when errors | 11465 | nor uncorrelated, and the above formulas are valid only when errors |
| 11472 | are small. As an example, the error arising from | 11466 | are 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{)}' |
| 11475 | is | 11469 | is |
| 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{))}'. |
| 11478 | When @expr{x} is close to zero, | 11472 | When @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)} |
| 11481 | is close to one so the error in the sine is close to | 11475 | is 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}; |
| 11484 | this makes sense, since | 11478 | this makes sense, since |
| 11485 | @texline @tmath{\sin x} | 11479 | @texline @math{\sin x} |
| 11486 | @infoline @expr{sin(x)} | 11480 | @infoline @expr{sin(x)} |
| 11487 | is approximately @expr{x} near zero, so a given error in @expr{x} will | 11481 | is approximately @expr{x} near zero, so a given error in @expr{x} will |
| 11488 | produce about the same error in the sine. Likewise, near 90 degrees | 11482 | produce 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)} |
| 11491 | is nearly zero and so the computed error is | 11485 | is nearly zero and so the computed error is |
| 11492 | small: The sine curve is nearly flat in that region, so an error in @expr{x} | 11486 | small: The sine curve is nearly flat in that region, so an error in @expr{x} |
| 11493 | has relatively little effect on the value of | 11487 | has 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)}. |
| 11496 | However, consider @samp{sin(90 +/- 1000)}. The cosine of 90 is zero, so | 11490 | However, consider @samp{sin(90 +/- 1000)}. The cosine of 90 is zero, so |
| 11497 | Calc will report zero error! We get an obviously wrong result because | 11491 | Calc will report zero error! We get an obviously wrong result because |
| 11498 | we have violated the small-error approximation underlying the error | 11492 | we have violated the small-error approximation underlying the error |
| 11499 | analysis. If the error in @expr{x} had been small, the error in | 11493 | analysis. 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)} |
| 11502 | would indeed have been negligible. | 11496 | would indeed have been negligible. |
| 11503 | 11497 | ||
| @@ -11593,10 +11587,10 @@ rather than @samp{1 ..@: 0.1e2}. Add spaces or zeros if you want to | |||
| 11593 | get the other interpretation. If you omit the lower or upper limit, | 11587 | get the other interpretation. If you omit the lower or upper limit, |
| 11594 | a default of @samp{-inf} or @samp{inf} (respectively) is furnished. | 11588 | a default of @samp{-inf} or @samp{inf} (respectively) is furnished. |
| 11595 | 11589 | ||
| 11596 | ``Infinite mode'' also affects operations on intervals | 11590 | Infinite 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, |
| 11598 | as in @samp{1 / (0 .. 2] = [0.5 .. inf)}. But closed infinities, | 11592 | as 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; |
| 11600 | otherwise they are left unevaluated. Note that the ``direction'' of | 11594 | otherwise they are left unevaluated. Note that the ``direction'' of |
| 11601 | a zero is not an issue in this case since the zero is always assumed | 11595 | a zero is not an issue in this case since the zero is always assumed |
| 11602 | to be continuous with the rest of the interval. For intervals that | 11596 | to 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, | |||
| 11606 | While it may seem that intervals and error forms are similar, they are | 11600 | While it may seem that intervals and error forms are similar, they are |
| 11607 | based on entirely different concepts of inexact quantities. An error | 11601 | based on entirely different concepts of inexact quantities. An error |
| 11608 | form | 11602 | form |
| 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}' |
| 11611 | means a variable is random, and its value could | 11605 | means a variable is random, and its value could |
| 11612 | be anything but is ``probably'' within one | 11606 | be anything but is ``probably'' within one |
| 11613 | @texline @tmath{\sigma} | 11607 | @texline @math{\sigma} |
| 11614 | @infoline @var{sigma} | 11608 | @infoline @var{sigma} |
| 11615 | of the mean value @expr{x}. An interval | 11609 | of 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 | ||
| 11845 | Note that, unlike in usual computer notation, multiplication binds more | 11839 | Note that, unlike in usual computer notation, multiplication binds more |
| 11846 | strongly than division: @samp{a*b/c*d} is equivalent to | 11840 | strongly 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 | |||
| 11911 | algebraic entry (@kbd{'}), editing commands like @kbd{`} which parse | 11905 | algebraic entry (@kbd{'}), editing commands like @kbd{`} which parse |
| 11912 | the contents of the editing buffer when you finish, the @kbd{M-# g} | 11906 | the contents of the editing buffer when you finish, the @kbd{M-# g} |
| 11913 | and @w{@kbd{M-# r}} commands, the @kbd{C-y} command, the X window system | 11907 | and @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 |
| 11915 | use the same rules for parsing formulas; in particular, language modes | 11909 | use 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 | |||
| 12042 | element at level @var{n} up to the top. (Compare with @key{LFD}, | 12036 | element at level @var{n} up to the top. (Compare with @key{LFD}, |
| 12043 | which copies instead of moving the element in level @var{n}.) | 12037 | which copies instead of moving the element in level @var{n}.) |
| 12044 | 12038 | ||
| 12045 | With a negative argument @i{-@var{n}}, @key{TAB} rotates the stack | 12039 | With a negative argument @mathit{-@var{n}}, @key{TAB} rotates the stack |
| 12046 | to move the object in level @var{n} to the deepest place in the | 12040 | to move the object in level @var{n} to the deepest place in the |
| 12047 | stack, and the object in level @i{@var{n}+1} to the top. @kbd{M-@key{TAB}} | 12041 | stack, and the object in level @mathit{@var{n}+1} to the top. @kbd{M-@key{TAB}} |
| 12048 | rotates the deepest stack element to be in level @i{n}, also | 12042 | rotates the deepest stack element to be in level @mathit{n}, also |
| 12049 | putting the top stack element in level @i{@var{n}+1}. | 12043 | putting 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 |
| 12052 | any portion of a vector or formula on the stack. | 12046 | any 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 |
| 12321 | The @kbd{m R} (@code{calc-mode-record-mode}) command tells Calc to | 12315 | The @kbd{m R} (@code{calc-mode-record-mode}) command tells Calc to |
| 12322 | record the new mode settings (as if by pressing @kbd{m m}) every | 12316 | record the new mode settings (as if by pressing @kbd{m m}) every |
| 12323 | time a mode setting changes. If Embedded Mode is enabled, other | 12317 | time a mode setting changes. If Embedded mode is enabled, other |
| 12324 | options are available; @pxref{Mode Settings in Embedded Mode}. | 12318 | options 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 | |||
| 12341 | is because you are presumably switching to your @file{~/.emacs} file, | 12335 | is because you are presumably switching to your @file{~/.emacs} file, |
| 12342 | which may contain other things you don't want to reread. You can give | 12336 | which may contain other things you don't want to reread. You can give |
| 12343 | a numeric prefix argument of 1 to @kbd{m F} to force it to read the | 12337 | a numeric prefix argument of 1 to @kbd{m F} to force it to read the |
| 12344 | file no matter what its name. Conversely, an argument of @i{-1} tells | 12338 | file 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} |
| 12346 | tells @kbd{m F} not to reset the modes to their defaults beforehand, | 12340 | tells @kbd{m F} not to reset the modes to their defaults beforehand, |
| 12347 | which is useful if you intend your new file to have a variant of the | 12341 | which is useful if you intend your new file to have a variant of the |
| 12348 | modes present in the file you were using before. | 12342 | modes present in the file you were using before. |
| @@ -12447,7 +12441,7 @@ Hyperbolic Flag, which transforms @code{calc-sin} into @code{calc-sinh}. | |||
| 12447 | If both of these flags are set at once, the effect will be | 12441 | If 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 |
| 12449 | non-trigonometric commands; for example @kbd{H L} computes a base-10, | 12443 | non-trigonometric commands; for example @kbd{H L} computes a base-10, |
| 12450 | instead of base-@i{e}, logarithm.) | 12444 | instead of base-@mathit{e}, logarithm.) |
| 12451 | 12445 | ||
| 12452 | Command names like @code{calc-arcsin} are provided for completeness, and | 12446 | Command names like @code{calc-arcsin} are provided for completeness, and |
| 12453 | may be executed with @kbd{x} or @kbd{M-x}. Their effect is simply to | 12447 | may 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 | |||
| 12501 | degrees, or an HMS form depending on the current angular mode. If the | 12495 | degrees, or an HMS form depending on the current angular mode. If the |
| 12502 | result is a complex number and the current mode is HMS, the number is | 12496 | result is a complex number and the current mode is HMS, the number is |
| 12503 | instead expressed in degrees. (Complex-number calculations would | 12497 | instead expressed in degrees. (Complex-number calculations would |
| 12504 | normally be done in radians mode, though. Complex numbers are converted | 12498 | normally be done in Radians mode, though. Complex numbers are converted |
| 12505 | to degrees by calculating the complex result in radians and then | 12499 | to degrees by calculating the complex result in radians and then |
| 12506 | multiplying by 180 over @cpi{}.) | 12500 | multiplying by 180 over @cpi{}.) |
| 12507 | 12501 | ||
| @@ -12514,7 +12508,7 @@ multiplying by 180 over @cpi{}.) | |||
| 12514 | The @kbd{m r} (@code{calc-radians-mode}), @kbd{m d} (@code{calc-degrees-mode}), | 12508 | The @kbd{m r} (@code{calc-radians-mode}), @kbd{m d} (@code{calc-degrees-mode}), |
| 12515 | and @kbd{m h} (@code{calc-hms-mode}) commands control the angular mode. | 12509 | and @kbd{m h} (@code{calc-hms-mode}) commands control the angular mode. |
| 12516 | The current angular mode is displayed on the Emacs mode line. | 12510 | The current angular mode is displayed on the Emacs mode line. |
| 12517 | The default angular mode is degrees. | 12511 | The 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 |
| 12532 | The @kbd{m p} (@code{calc-polar-mode}) command toggles complex-number | 12526 | The @kbd{m p} (@code{calc-polar-mode}) command toggles complex-number |
| 12533 | preference between rectangular and polar forms. In polar mode, all | 12527 | preference between rectangular and polar forms. In Polar mode, all |
| 12534 | of the above example situations would produce polar complex numbers. | 12528 | of 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}. | |||
| 12550 | To set the Calculator to produce fractional results for normal integer | 12544 | To set the Calculator to produce fractional results for normal integer |
| 12551 | divisions, use the @kbd{m f} (@code{calc-frac-mode}) command. | 12545 | divisions, use the @kbd{m f} (@code{calc-frac-mode}) command. |
| 12552 | For example, @expr{8/4} produces @expr{2} in either mode, | 12546 | For example, @expr{8/4} produces @expr{2} in either mode, |
| 12553 | but @expr{6/4} produces @expr{3:2} in Fraction Mode, @expr{1.5} in | 12547 | but @expr{6/4} produces @expr{3:2} in Fraction mode, @expr{1.5} in |
| 12554 | Float Mode. | 12548 | Float mode. |
| 12555 | 12549 | ||
| 12556 | At any time you can use @kbd{c f} (@code{calc-float}) to convert a | 12550 | At any time you can use @kbd{c f} (@code{calc-float}) to convert a |
| 12557 | fraction to a float, or @kbd{c F} (@code{calc-fraction}) to convert a | 12551 | fraction 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 | |||
| 12574 | in calculations that already had infinities as inputs. (One exception | 12568 | in calculations that already had infinities as inputs. (One exception |
| 12575 | is that infinite open intervals like @samp{[0 .. inf)} can be | 12569 | is that infinite open intervals like @samp{[0 .. inf)} can be |
| 12576 | generated; however, intervals closed at infinity (@samp{[0 .. inf]}) | 12570 | generated; however, intervals closed at infinity (@samp{[0 .. inf]}) |
| 12577 | will not be generated when infinite mode is off.) | 12571 | will not be generated when Infinite mode is off.) |
| 12578 | 12572 | ||
| 12579 | With infinite mode turned on, @samp{1 / 0} will generate @code{uinf}, | 12573 | With Infinite mode turned on, @samp{1 / 0} will generate @code{uinf}, |
| 12580 | an undirected infinity. @xref{Infinities}, for a discussion of the | 12574 | an undirected infinity. @xref{Infinities}, for a discussion of the |
| 12581 | difference between @code{inf} and @code{uinf}. Also, @expr{0 / 0} | 12575 | difference between @code{inf} and @code{uinf}. Also, @expr{0 / 0} |
| 12582 | evaluates to @code{nan}, the ``indeterminate'' symbol. Various other | 12576 | evaluates to @code{nan}, the ``indeterminate'' symbol. Various other |
| 12583 | functions can also return infinities in this mode; for example, | 12577 | functions 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, |
| 12585 | note that @samp{exp(inf) = inf} regardless of infinite mode because | 12579 | note that @samp{exp(inf) = inf} regardless of Infinite mode because |
| 12586 | this calculation has infinity as an input. | 12580 | this calculation has infinity as an input. |
| 12587 | 12581 | ||
| 12588 | @cindex Positive infinite mode | 12582 | @cindex Positive Infinite mode |
| 12589 | The @kbd{m i} command with a numeric prefix argument of zero, | 12583 | The @kbd{m i} command with a numeric prefix argument of zero, |
| 12590 | i.e., @kbd{C-u 0 m i}, turns on a ``positive infinite mode'' in | 12584 | i.e., @kbd{C-u 0 m i}, turns on a Positive Infinite mode in |
| 12591 | which zero is treated as positive instead of being directionless. | 12585 | which zero is treated as positive instead of being directionless. |
| 12592 | Thus, @samp{1 / 0 = inf} and @samp{-1 / 0 = -inf} in this mode. | 12586 | Thus, @samp{1 / 0 = inf} and @samp{-1 / 0 = -inf} in this mode. |
| 12593 | Note that zero never actually has a sign in Calc; there are no | 12587 | Note that zero never actually has a sign in Calc; there are no |
| 12594 | separate representations for @i{+0} and @i{-0}. Positive | 12588 | separate representations for @mathit{+0} and @mathit{-0}. Positive |
| 12595 | infinite mode merely changes the interpretation given to the | 12589 | Infinite mode merely changes the interpretation given to the |
| 12596 | single symbol, @samp{0}. One consequence of this is that, while | 12590 | single symbol, @samp{0}. One consequence of this is that, while |
| 12597 | you might expect @samp{1 / -0 = -inf}, actually @samp{1 / -0} | 12591 | you might expect @samp{1 / -0 = -inf}, actually @samp{1 / -0} |
| 12598 | is equivalent to @samp{1 / 0}, which is equal to positive @code{inf}. | 12592 | is 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 |
| 12614 | In @dfn{symbolic mode}, controlled by the @kbd{m s} (@code{calc-symbolic-mode}) | 12608 | In @dfn{Symbolic mode}, controlled by the @kbd{m s} (@code{calc-symbolic-mode}) |
| 12615 | command, functions which would produce inexact, irrational results are | 12609 | command, functions which would produce inexact, irrational results are |
| 12616 | left in symbolic form. Thus @kbd{16 Q} pushes 4, but @kbd{2 Q} pushes | 12610 | left 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 |
| 12639 | Calc sometimes makes assumptions during algebraic manipulation that | 12633 | Calc sometimes makes assumptions during algebraic manipulation that |
| 12640 | are awkward or incorrect when vectors and matrices are involved. | 12634 | are awkward or incorrect when vectors and matrices are involved. |
| 12641 | Calc has two modes, @dfn{matrix mode} and @dfn{scalar mode}, which | 12635 | Calc has two modes, @dfn{Matrix mode} and @dfn{Scalar mode}, which |
| 12642 | modify its behavior around vectors in useful ways. | 12636 | modify 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 |
| 12646 | Press @kbd{m v} (@code{calc-matrix-mode}) once to enter matrix mode. | 12640 | Press @kbd{m v} (@code{calc-matrix-mode}) once to enter Matrix mode. |
| 12647 | In this mode, all objects are assumed to be matrices unless provably | 12641 | In this mode, all objects are assumed to be matrices unless provably |
| 12648 | otherwise. One major effect is that Calc will no longer consider | 12642 | otherwise. One major effect is that Calc will no longer consider |
| 12649 | multiplication to be commutative. (Recall that in matrix arithmetic, | 12643 | multiplication to be commutative. (Recall that in matrix arithmetic, |
| @@ -12662,18 +12656,18 @@ a true identity matrix of the appropriate size. On the other hand, | |||
| 12662 | if it is combined with a scalar (as in @samp{idn(1) + 2}), Calc | 12656 | if it is combined with a scalar (as in @samp{idn(1) + 2}), Calc |
| 12663 | will assume it really was a scalar after all and produce, e.g., 3. | 12657 | will assume it really was a scalar after all and produce, e.g., 3. |
| 12664 | 12658 | ||
| 12665 | Press @kbd{m v} a second time to get scalar mode. Here, objects are | 12659 | Press @kbd{m v} a second time to get Scalar mode. Here, objects are |
| 12666 | assumed @emph{not} to be vectors or matrices unless provably so. | 12660 | assumed @emph{not} to be vectors or matrices unless provably so. |
| 12667 | For example, normally adding a variable to a vector, as in | 12661 | For 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 |
| 12669 | as far as Calc knows, @samp{a} could represent either a number or | 12663 | as far as Calc knows, @samp{a} could represent either a number or |
| 12670 | another 3-vector. In scalar mode, @samp{a} is assumed to be a | 12664 | another 3-vector. In Scalar mode, @samp{a} is assumed to be a |
| 12671 | non-vector, and the addition is evaluated to @samp{[x+a, y+a, z+a]}. | 12665 | non-vector, and the addition is evaluated to @samp{[x+a, y+a, z+a]}. |
| 12672 | 12666 | ||
| 12673 | Press @kbd{m v} a third time to return to the normal mode of operation. | 12667 | Press @kbd{m v} a third time to return to the normal mode of operation. |
| 12674 | 12668 | ||
| 12675 | If you press @kbd{m v} with a numeric prefix argument @var{n}, you | 12669 | If you press @kbd{m v} with a numeric prefix argument @var{n}, you |
| 12676 | get a special ``dimensioned matrix mode'' in which matrices of | 12670 | get a special ``dimensioned'' Matrix mode in which matrices of |
| 12677 | unknown size are assumed to be @var{n}x@var{n} square matrices. | 12671 | unknown size are assumed to be @var{n}x@var{n} square matrices. |
| 12678 | Then, the function call @samp{idn(1)} will expand into an actual | 12672 | Then, the function call @samp{idn(1)} will expand into an actual |
| 12679 | matrix rather than representing a ``generic'' matrix. | 12673 | matrix 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 | |||
| 12694 | your earlier promise to Calc that @samp{a} would be scalar. | 12688 | your earlier promise to Calc that @samp{a} would be scalar. |
| 12695 | 12689 | ||
| 12696 | Another way to mix scalars and matrices is to use selections | 12690 | Another 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 |
| 12698 | your formula normally; then, to apply scalar mode to a certain part | 12692 | your formula normally; then, to apply Scalar mode to a certain part |
| 12699 | of the formula without affecting the rest just select that part, | 12693 | of the formula without affecting the rest just select that part, |
| 12700 | change into scalar mode and press @kbd{=} to resimplify the part | 12694 | change into Scalar mode and press @kbd{=} to resimplify the part |
| 12701 | under this mode, then change back to matrix mode before deselecting. | 12695 | under 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}. | |||
| 12714 | The @kbd{m C} (@code{calc-auto-recompute}) command turns this | 12708 | The @kbd{m C} (@code{calc-auto-recompute}) command turns this |
| 12715 | automatic recomputation on and off. If you turn it off, Calc will | 12709 | automatic recomputation on and off. If you turn it off, Calc will |
| 12716 | not update @samp{=>} operators on the stack (nor those in the | 12710 | not update @samp{=>} operators on the stack (nor those in the |
| 12717 | attached Embedded Mode buffer, if there is one). They will not | 12711 | attached Embedded mode buffer, if there is one). They will not |
| 12718 | be updated unless you explicitly do so by pressing @kbd{=} or until | 12712 | be updated unless you explicitly do so by pressing @kbd{=} or until |
| 12719 | you press @kbd{m C} to turn recomputation back on. (While automatic | 12713 | you press @kbd{m C} to turn recomputation back on. (While automatic |
| 12720 | recomputation is off, you can think of @kbd{m C m C} as a command | 12714 | recomputation 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 | |||
| 12835 | amount of simplification you will allow to be applied automatically, then | 12829 | amount of simplification you will allow to be applied automatically, then |
| 12836 | use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to | 12830 | use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to |
| 12837 | perform higher types of simplifications on demand. @xref{Algebraic | 12831 | perform higher types of simplifications on demand. @xref{Algebraic |
| 12838 | Definitions}, for another sample use of no-simplification mode. | 12832 | Definitions}, 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.) | |||
| 12982 | Calc uses this information to determine when certain simplifications | 12976 | Calc uses this information to determine when certain simplifications |
| 12983 | of formulas are safe. For example, @samp{(x^y)^z} cannot be | 12977 | of formulas are safe. For example, @samp{(x^y)^z} cannot be |
| 12984 | simplified to @samp{x^(y z)} in general; for example, | 12978 | simplified 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}. |
| 12986 | However, this simplification @emph{is} safe if @code{z} is known | 12980 | However, this simplification @emph{is} safe if @code{z} is known |
| 12987 | to be an integer, or if @code{x} is known to be a nonnegative | 12981 | to be an integer, or if @code{x} is known to be a nonnegative |
| 12988 | real number. If you have given declarations that allow Calc to | 12982 | real 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 | |||
| 13082 | never distinguishes between @code{vector} and @code{matrix} | 13076 | never distinguishes between @code{vector} and @code{matrix} |
| 13083 | declarations.) | 13077 | declarations.) |
| 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]} | 13080 | Scalar mode, which are similar to declaring @samp{[All, matrix]} |
| 13087 | or @samp{[All, scalar]} but much more convenient. | 13081 | or @samp{[All, scalar]} but much more convenient. |
| 13088 | 13082 | ||
| 13089 | One more type symbol that is recognized is used with the @kbd{H a d} | 13083 | One 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 | ||
| 13097 | Calc does not check the declarations for a variable when you store | 13091 | Calc does not check the declarations for a variable when you store |
| 13098 | a value in it. However, storing @i{-3.5} in a variable that has | 13092 | a value in it. However, storing @mathit{-3.5} in a variable that has |
| 13099 | been declared @code{pos}, @code{int}, or @code{matrix} may have | 13093 | been declared @code{pos}, @code{int}, or @code{matrix} may have |
| 13100 | unexpected effects; Calc may evaluate @samp{sqrt(x^2)} to @expr{3.5} | 13094 | unexpected effects; Calc may evaluate @samp{sqrt(x^2)} to @expr{3.5} |
| 13101 | if it substitutes the value first, or to @expr{-3.5} if @code{x} | 13095 | if 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 |
| 13236 | The @code{dscalar} function returns 1 if its argument is provably | 13230 | The @code{dscalar} function returns 1 if its argument is provably |
| 13237 | scalar, or 0 if its argument is provably non-scalar. It is left | 13231 | scalar, or 0 if its argument is provably non-scalar. It is left |
| 13238 | unevaluated if this cannot be determined. (If matrix mode or scalar | 13232 | unevaluated if this cannot be determined. (If Matrix mode or Scalar |
| 13239 | mode are in effect, this function returns 1 or 0, respectively, | 13233 | mode is in effect, this function returns 1 or 0, respectively, |
| 13240 | if it has no other information.) When Calc interprets a condition | 13234 | if 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 | |||
| 13330 | current binary word size. (@xref{Binary Functions}, for a discussion of | 13324 | current binary word size. (@xref{Binary Functions}, for a discussion of |
| 13331 | word size.) If the absolute value of the word size is @expr{w}, all integers | 13325 | word size.) If the absolute value of the word size is @expr{w}, all integers |
| 13332 | are displayed with at least enough digits to represent | 13326 | are 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} |
| 13335 | in the current radix. (Larger integers will still be displayed in their | 13329 | in the current radix. (Larger integers will still be displayed in their |
| 13336 | entirety.) | 13330 | entirety.) |
| @@ -13345,7 +13339,7 @@ entirety.) | |||
| 13345 | @cindex Digit grouping | 13339 | @cindex Digit grouping |
| 13346 | Long numbers can be hard to read if they have too many digits. For | 13340 | Long numbers can be hard to read if they have too many digits. For |
| 13347 | example, the factorial of 30 is 33 digits long! Press @kbd{d g} | 13341 | example, 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 |
| 13349 | are displayed in clumps of 3 or 4 (depending on the current radix) | 13343 | are displayed in clumps of 3 or 4 (depending on the current radix) |
| 13350 | separated by commas. | 13344 | separated by commas. |
| 13351 | 13345 | ||
| @@ -13891,7 +13885,7 @@ line at a time (or several lines with a prefix argument). | |||
| 13891 | Values on the stack are normally left-justified in the window. You can | 13885 | Values on the stack are normally left-justified in the window. You can |
| 13892 | control this arrangement by typing @kbd{d <} (@code{calc-left-justify}), | 13886 | control 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, |
| 13895 | stack entries are displayed flush-right against the right edge of the | 13889 | stack entries are displayed flush-right against the right edge of the |
| 13896 | window. | 13890 | window. |
| 13897 | 13891 | ||
| @@ -13912,20 +13906,20 @@ breaking lines are given below. Notice that the interaction between | |||
| 13912 | origin and line width is slightly different in each justification | 13906 | origin and line width is slightly different in each justification |
| 13913 | mode. | 13907 | mode. |
| 13914 | 13908 | ||
| 13915 | In left-justified mode, the line is indented by a number of spaces | 13909 | In Left-Justified mode, the line is indented by a number of spaces |
| 13916 | given by the origin (default zero). If the result is longer than the | 13910 | given by the origin (default zero). If the result is longer than the |
| 13917 | maximum line width, if given, or too wide to fit in the Calc window | 13911 | maximum line width, if given, or too wide to fit in the Calc window |
| 13918 | otherwise, then it is broken into lines which will fit; each broken | 13912 | otherwise, then it is broken into lines which will fit; each broken |
| 13919 | line is indented to the origin. | 13913 | line is indented to the origin. |
| 13920 | 13914 | ||
| 13921 | In right-justified mode, lines are shifted right so that the rightmost | 13915 | In Right-Justified mode, lines are shifted right so that the rightmost |
| 13922 | character is just before the origin, or just before the current | 13916 | character is just before the origin, or just before the current |
| 13923 | window width if no origin was specified. If the line is too long | 13917 | window width if no origin was specified. If the line is too long |
| 13924 | for this, then it is broken; the current line width is used, if | 13918 | for this, then it is broken; the current line width is used, if |
| 13925 | specified, or else the origin is used as a width if that is | 13919 | specified, or else the origin is used as a width if that is |
| 13926 | specified, or else the line is broken to fit in the window. | 13920 | specified, or else the line is broken to fit in the window. |
| 13927 | 13921 | ||
| 13928 | In centering mode, the origin is the column number of the center of | 13922 | In Centering mode, the origin is the column number of the center of |
| 13929 | each stack entry. If a line width is specified, lines will not be | 13923 | each stack entry. If a line width is specified, lines will not be |
| 13930 | allowed to go past that width; Calc will either indent less or | 13924 | allowed to go past that width; Calc will either indent less or |
| 13931 | break the lines if necessary. If no origin is specified, half the | 13925 | break 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. | |||
| 13960 | The @kbd{d @}} (@code{calc-right-label}) command similarly adds a | 13954 | The @kbd{d @}} (@code{calc-right-label}) command similarly adds a |
| 13961 | label on the righthand side. It does not affect positioning of | 13955 | label on the righthand side. It does not affect positioning of |
| 13962 | the stack entries unless they are right-justified. Also, if both | 13956 | the stack entries unless they are right-justified. Also, if both |
| 13963 | a line width and an origin are given in right-justified mode, the | 13957 | a line width and an origin are given in Right-Justified mode, the |
| 13964 | stack entry is justified to the origin and the righthand label is | 13958 | stack entry is justified to the origin and the righthand label is |
| 13965 | justified to the line width. | 13959 | justified to the line width. |
| 13966 | 13960 | ||
| 13967 | One application of labels would be to add equation numbers to | 13961 | One application of labels would be to add equation numbers to |
| 13968 | formulas you are manipulating in Calc and then copying into a | 13962 | formulas you are manipulating in Calc and then copying into a |
| 13969 | document (possibly using Embedded Mode). The equations would | 13963 | document (possibly using Embedded mode). The equations would |
| 13970 | typically be centered, and the equation numbers would be on the | 13964 | typically be centered, and the equation numbers would be on the |
| 13971 | left or right as you prefer. | 13965 | left or right as you prefer. |
| 13972 | 13966 | ||
| @@ -14068,7 +14062,7 @@ such as powers, quotients, and square roots: | |||
| 14068 | @noindent | 14062 | @noindent |
| 14069 | in place of @samp{sqrt((a+1)/b + c^2)}. | 14063 | in place of @samp{sqrt((a+1)/b + c^2)}. |
| 14070 | 14064 | ||
| 14071 | Subscripts like @samp{a_i} are displayed as actual subscripts in ``big'' | 14065 | Subscripts like @samp{a_i} are displayed as actual subscripts in Big |
| 14072 | mode. Double subscripts, @samp{a_i_j} (@samp{subscr(subscr(a, i), j)}) | 14066 | mode. Double subscripts, @samp{a_i_j} (@samp{subscr(subscr(a, i), j)}) |
| 14073 | are displayed as @samp{a} with subscripts separated by commas: | 14067 | are 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. | |||
| 14141 | Octal and hexadecimal values are written with leading @samp{0} or @samp{0x} | 14135 | Octal and hexadecimal values are written with leading @samp{0} or @samp{0x} |
| 14142 | rather than using the @samp{#} symbol. Array subscripting is | 14136 | rather than using the @samp{#} symbol. Array subscripting is |
| 14143 | translated into @code{subscr} calls, so that @samp{a[i]} in C | 14137 | translated into @code{subscr} calls, so that @samp{a[i]} in C |
| 14144 | mode is the same as @samp{a_i} in normal mode. Assignments | 14138 | mode is the same as @samp{a_i} in Normal mode. Assignments |
| 14145 | turn into the @code{assign} function, which Calc normally displays | 14139 | turn into the @code{assign} function, which Calc normally displays |
| 14146 | using the @samp{:=} symbol. | 14140 | using the @samp{:=} symbol. |
| 14147 | 14141 | ||
| 14148 | The variables @code{var-pi} and @code{var-e} would be displayed @samp{pi} | 14142 | The variables @code{var-pi} and @code{var-e} would be displayed @samp{pi} |
| 14149 | and @samp{e} in normal mode, but in C mode they are displayed as | 14143 | and @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 |
| 14151 | typically provided in the @file{<math.h>} header. Functions whose | 14145 | typically provided in the @file{<math.h>} header. Functions whose |
| 14152 | names are different in C are translated automatically for entry and | 14146 | names are different in C are translated automatically for entry and |
| @@ -14188,7 +14182,7 @@ function!). | |||
| 14188 | 14182 | ||
| 14189 | Underscores are allowed in variable and function names in all of these | 14183 | Underscores are allowed in variable and function names in all of these |
| 14190 | language modes. The underscore here is equivalent to the @samp{#} in | 14184 | language modes. The underscore here is equivalent to the @samp{#} in |
| 14191 | normal mode, or to hyphens in the underlying Emacs Lisp variable names. | 14185 | Normal mode, or to hyphens in the underlying Emacs Lisp variable names. |
| 14192 | 14186 | ||
| 14193 | FORTRAN and Pascal modes normally do not adjust the case of letters in | 14187 | FORTRAN and Pascal modes normally do not adjust the case of letters in |
| 14194 | formulas. Most built-in Calc names use lower-case letters. If you use a | 14188 | formulas. 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 | |||
| 14231 | parentheses for very simple arguments. During input, curly braces and | 14225 | parentheses for very simple arguments. During input, curly braces and |
| 14232 | parentheses work equally well for grouping, but when the document is | 14226 | parentheses work equally well for grouping, but when the document is |
| 14233 | formatted the curly braces will be invisible. Thus the printed result is | 14227 | formatted 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} |
| 14236 | but | 14230 | but |
| 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 | ||
| 14240 | Function and variable names not treated specially by @TeX{} are simply | 14234 | Function and variable names not treated specially by @TeX{} are simply |
| @@ -14830,7 +14824,7 @@ object. | |||
| 14830 | @tindex choriz | 14824 | @tindex choriz |
| 14831 | The @code{choriz} function takes a vector of objects and composes | 14825 | The @code{choriz} function takes a vector of objects and composes |
| 14832 | them horizontally. For example, @samp{choriz([17, a b/c, d])} formats | 14826 | them horizontally. For example, @samp{choriz([17, a b/c, d])} formats |
| 14833 | as @w{@samp{17a b / cd}} in normal language mode, or as | 14827 | as @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 |
| 15094 | The @code{cwidth} function measures the width, in characters, of a | 15088 | The @code{cwidth} function measures the width, in characters, of a |
| 15095 | composition. For example, @samp{cwidth(a + b)} is 5, and | 15089 | composition. 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 |
| 15098 | the composition functions described in this section. | 15092 | the 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 |
| 15270 | The @kbd{Z S} (@code{calc-edit-user-syntax}) command edits the | 15264 | The @kbd{Z S} (@code{calc-edit-user-syntax}) command edits the |
| 15271 | syntax table for the current language mode. If you want your | 15265 | syntax table for the current language mode. If you want your |
| 15272 | syntax to work in any language, define it in the normal language | 15266 | syntax to work in any language, define it in the Normal language |
| 15273 | mode. Type @kbd{M-# M-#} to finish editing the syntax table, or | 15267 | mode. 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 |
| 15275 | the syntax tables along with the other mode settings; | 15269 | the syntax tables along with the other mode settings; |
| @@ -15300,7 +15294,7 @@ zero or more expressions separated by commas, and @samp{)}.'' | |||
| 15300 | A @dfn{syntax table} is a list of user-defined @dfn{syntax rules}, | 15294 | A @dfn{syntax table} is a list of user-defined @dfn{syntax rules}, |
| 15301 | which allow you to specify new patterns to define your own | 15295 | which allow you to specify new patterns to define your own |
| 15302 | favorite input notations. Calc's parser always checks the syntax | 15296 | favorite input notations. Calc's parser always checks the syntax |
| 15303 | table for the current language mode, then the table for the normal | 15297 | table for the current language mode, then the table for the Normal |
| 15304 | language mode, before it uses its built-in rules to parse an | 15298 | language mode, before it uses its built-in rules to parse an |
| 15305 | algebraic formula you have entered. Each syntax rule should go on | 15299 | algebraic formula you have entered. Each syntax rule should go on |
| 15306 | its own line; it consists of a @dfn{pattern}, a @samp{:=} symbol, | 15300 | its 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 |
| 15656 | its components. If the expression turns out not to match the pattern, | 15650 | its components. If the expression turns out not to match the pattern, |
| 15657 | the syntax rule will fail. Note that @kbd{Z S} always uses Calc's | 15651 | the syntax rule will fail. Note that @kbd{Z S} always uses Calc's |
| 15658 | normal language mode for editing expressions in syntax rules, so we | 15652 | Normal language mode for editing expressions in syntax rules, so we |
| 15659 | must use regular Calc notation for the interval @samp{[b..c]} that | 15653 | must use regular Calc notation for the interval @samp{[b..c]} that |
| 15660 | will correspond to the Maple mode interval @samp{1..10}. | 15654 | will 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. | |||
| 15728 | Command is @kbd{m p}. | 15722 | Command is @kbd{m p}. |
| 15729 | 15723 | ||
| 15730 | @item | 15724 | @item |
| 15731 | Matrix/scalar mode. Default value is @i{-1}. Value is 0 for scalar | 15725 | Matrix/Scalar mode. Default value is @mathit{-1}. Value is 0 for Scalar |
| 15732 | mode, @i{-2} for matrix mode, or @var{N} for | 15726 | mode, @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} |
| 15735 | matrix mode. Command is @kbd{m v}. | 15729 | Matrix mode. Command is @kbd{m v}. |
| 15736 | 15730 | ||
| 15737 | @item | 15731 | @item |
| 15738 | Simplification mode. Default is 1. Value is @i{-1} for off (@kbd{m O}), | 15732 | Simplification mode. Default is 1. Value is @mathit{-1} for off (@kbd{m O}), |
| 15739 | 0 for @kbd{m N}, 2 for @kbd{m B}, 3 for @kbd{m A}, 4 for @kbd{m E}, | 15733 | 0 for @kbd{m N}, 2 for @kbd{m B}, 3 for @kbd{m A}, 4 for @kbd{m E}, |
| 15740 | or 5 for @w{@kbd{m U}}. The @kbd{m D} command accepts these prefixes. | 15734 | or 5 for @w{@kbd{m U}}. The @kbd{m D} command accepts these prefixes. |
| 15741 | 15735 | ||
| 15742 | @item | 15736 | @item |
| 15743 | Infinite mode. Default is @i{-1} (off). Value is 1 if the mode is on, | 15737 | Infinite mode. Default is @mathit{-1} (off). Value is 1 if the mode is on, |
| 15744 | or 0 if the mode is on with positive zeros. Command is @kbd{m i}. | 15738 | or 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 |
| 15768 | This section is a summary of all symbols that can appear on the | 15762 | This section is a summary of all symbols that can appear on the |
| 15769 | Calc mode line, the highlighted bar that appears under the Calc | 15763 | Calc mode line, the highlighted bar that appears under the Calc |
| 15770 | stack window (or under an editing window in Embedded Mode). | 15764 | stack window (or under an editing window in Embedded mode). |
| 15771 | 15765 | ||
| 15772 | The basic mode line format is: | 15766 | The basic mode line format is: |
| 15773 | 15767 | ||
| @@ -15779,7 +15773,7 @@ The @samp{%%} is the Emacs symbol for ``read-only''; it shows that | |||
| 15779 | regular Emacs commands are not allowed to edit the stack buffer | 15773 | regular Emacs commands are not allowed to edit the stack buffer |
| 15780 | as if it were text. | 15774 | as if it were text. |
| 15781 | 15775 | ||
| 15782 | The word @samp{Calc:} changes to @samp{CalcEmbed:} if Embedded Mode | 15776 | The word @samp{Calc:} changes to @samp{CalcEmbed:} if Embedded mode |
| 15783 | is enabled. The words after this describe the various Calc modes | 15777 | is enabled. The words after this describe the various Calc modes |
| 15784 | that are in effect. | 15778 | that are in effect. |
| 15785 | 15779 | ||
| @@ -15807,7 +15801,7 @@ Symbolic mode (@kbd{m s}; @pxref{Symbolic Mode}). | |||
| 15807 | Matrix mode (@kbd{m v}; @pxref{Matrix Mode}). | 15801 | Matrix mode (@kbd{m v}; @pxref{Matrix Mode}). |
| 15808 | 15802 | ||
| 15809 | @item Matrix@var{n} | 15803 | @item Matrix@var{n} |
| 15810 | Dimensioned matrix mode (@kbd{C-u @var{n} m v}). | 15804 | Dimensioned Matrix mode (@kbd{C-u @var{n} m v}). |
| 15811 | 15805 | ||
| 15812 | @item Scalar | 15806 | @item Scalar |
| 15813 | Scalar mode (@kbd{m v}; @pxref{Matrix Mode}). | 15807 | Scalar mode (@kbd{m v}; @pxref{Matrix Mode}). |
| @@ -15822,7 +15816,7 @@ Fraction mode (@kbd{m f}; @pxref{Fraction Mode}). | |||
| 15822 | Infinite mode (@kbd{m i}; @pxref{Infinite Mode}). | 15816 | Infinite mode (@kbd{m i}; @pxref{Infinite Mode}). |
| 15823 | 15817 | ||
| 15824 | @item +Inf | 15818 | @item +Inf |
| 15825 | Positive infinite mode (@kbd{C-u 0 m i}). | 15819 | Positive Infinite mode (@kbd{C-u 0 m i}). |
| 15826 | 15820 | ||
| 15827 | @item NoSimp | 15821 | @item NoSimp |
| 15828 | Default simplifications off (@kbd{m O}; @pxref{Simplification Modes}). | 15822 | Default simplifications off (@kbd{m O}; @pxref{Simplification Modes}). |
| @@ -16030,14 +16024,14 @@ to every element of a vector. | |||
| 16030 | 16024 | ||
| 16031 | If either argument of @kbd{+} is a complex number, the result will in general | 16025 | If either argument of @kbd{+} is a complex number, the result will in general |
| 16032 | be complex. If one argument is in rectangular form and the other polar, | 16026 | be complex. If one argument is in rectangular form and the other polar, |
| 16033 | the current Polar Mode determines the form of the result. If Symbolic | 16027 | the current Polar mode determines the form of the result. If Symbolic |
| 16034 | Mode is enabled, the sum may be left as a formula if the necessary | 16028 | mode is enabled, the sum may be left as a formula if the necessary |
| 16035 | conversions for polar addition are non-trivial. | 16029 | conversions for polar addition are non-trivial. |
| 16036 | 16030 | ||
| 16037 | If both arguments of @kbd{+} are HMS forms, the forms are added according to | 16031 | If both arguments of @kbd{+} are HMS forms, the forms are added according to |
| 16038 | the usual conventions of hours-minutes-seconds notation. If one argument | 16032 | the usual conventions of hours-minutes-seconds notation. If one argument |
| 16039 | is an HMS form and the other is a number, that number is converted from | 16033 | is an HMS form and the other is a number, that number is converted from |
| 16040 | degrees or radians (depending on the current Angular Mode) to HMS format | 16034 | degrees or radians (depending on the current Angular mode) to HMS format |
| 16041 | and then the two HMS forms are added. | 16035 | and then the two HMS forms are added. |
| 16042 | 16036 | ||
| 16043 | If one argument of @kbd{+} is a date form, the other can be either a | 16037 | If 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 - |
| 16082 | The @kbd{-} (@code{calc-minus}) command subtracts two values. The top | 16076 | The @kbd{-} (@code{calc-minus}) command subtracts two values. The top |
| 16083 | number on the stack is subtracted from the one behind it, so that the | 16077 | number on the stack is subtracted from the one behind it, so that the |
| 16084 | computation @kbd{5 @key{RET} 2 -} produces 3, not @i{-3}. All options | 16078 | computation @kbd{5 @key{RET} 2 -} produces 3, not @mathit{-3}. All options |
| 16085 | available for @kbd{+} are available for @kbd{-} as well. | 16079 | available 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 |
| 16190 | The @kbd{:} (@code{calc-fdiv}) command [@code{fdiv} function in a formula] | 16184 | The @kbd{:} (@code{calc-fdiv}) command [@code{fdiv} function in a formula] |
| 16191 | divides the two integers on the top of the stack to produce a fractional | 16185 | divides the two integers on the top of the stack to produce a fractional |
| 16192 | result. This is a convenient shorthand for enabling Fraction Mode (with | 16186 | result. 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 |
| 16194 | the @kbd{:} key is interpreted as a fraction separator, so to divide 8 by 6 | 16188 | the @kbd{:} key is interpreted as a fraction separator, so to divide 8 by 6 |
| 16195 | you would have to type @kbd{8 @key{RET} 6 @key{RET} :}. (Of course, in | 16189 | you 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 |
| 16227 | The @kbd{f s} (@code{calc-sign}) [@code{sign}] command returns 1 if its | 16221 | The @kbd{f s} (@code{calc-sign}) [@code{sign}] command returns 1 if its |
| 16228 | argument is positive, @i{-1} if its argument is negative, or 0 if its | 16222 | argument is positive, @mathit{-1} if its argument is negative, or 0 if its |
| 16229 | argument is zero. In algebraic form, you can also write @samp{sign(a,x)} | 16223 | argument is zero. In algebraic form, you can also write @samp{sign(a,x)} |
| 16230 | which evaluates to @samp{x * sign(a)}, i.e., either @samp{x}, @samp{-x}, or | 16224 | which evaluates to @samp{x * sign(a)}, i.e., either @samp{x}, @samp{-x}, or |
| 16231 | zero depending on the sign of @samp{a}. | 16225 | zero 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 |
| 16244 | The @kbd{Q} (@code{calc-sqrt}) [@code{sqrt}] command computes the square | 16238 | The @kbd{Q} (@code{calc-sqrt}) [@code{sqrt}] command computes the square |
| 16245 | root of a number. For a negative real argument, the result will be a | 16239 | root of a number. For a negative real argument, the result will be a |
| 16246 | complex number whose form is determined by the current Polar Mode. | 16240 | complex 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 | |||
| 16288 | the ``mantissa'' part @expr{m} of its floating-point argument; @kbd{f X} | 16282 | the ``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}, |
| 16293 | where @expr{m} is in the interval @samp{[1.0 ..@: 10.0)} except that | 16287 | where @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 | |||
| 16305 | by a given power of ten. Thus, @samp{scf(mant(x), xpon(x)) = x} for any | 16299 | by a given power of ten. Thus, @samp{scf(mant(x), xpon(x)) = x} for any |
| 16306 | real @samp{x}. The second argument must be an integer, but the first | 16300 | real @samp{x}. The second argument must be an integer, but the first |
| 16307 | may actually be any numeric value. For example, @samp{scf(5,-2) = 0.05} | 16301 | may actually be any numeric value. For example, @samp{scf(5,-2) = 0.05} |
| 16308 | or @samp{1:20} depending on the current Fraction Mode. | 16302 | or @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 | |||
| 16321 | is 6 digits yields @samp{12.3457}. If the current precision had been | 16315 | is 6 digits yields @samp{12.3457}. If the current precision had been |
| 16322 | 8 digits, the result would have been @samp{12.345601}. Incrementing | 16316 | 8 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}, |
| 16326 | where @expr{p} is the current | 16320 | where @expr{p} is the current |
| 16327 | precision. These operations are defined only on integers and floats. | 16321 | precision. These operations are defined only on integers and floats. |
| @@ -16362,7 +16356,7 @@ expressed as an integer-valued floating-point number. | |||
| 16362 | The @kbd{F} (@code{calc-floor}) [@code{floor} or @code{ffloor}] command | 16356 | The @kbd{F} (@code{calc-floor}) [@code{floor} or @code{ffloor}] command |
| 16363 | truncates a real number to the next lower integer, i.e., toward minus | 16357 | truncates a real number to the next lower integer, i.e., toward minus |
| 16364 | infinity. Thus @kbd{3.6 F} produces 3, but @kbd{_3.6 F} produces | 16358 | infinity. 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 |
| 16375 | The @kbd{I F} (@code{calc-ceiling}) [@code{ceil} or @code{fceil}] | 16369 | The @kbd{I F} (@code{calc-ceiling}) [@code{ceil} or @code{fceil}] |
| 16376 | command truncates toward positive infinity. Thus @kbd{3.6 I F} produces | 16370 | command truncates toward positive infinity. Thus @kbd{3.6 I F} produces |
| 16377 | 4, and @kbd{_3.6 I F} produces @i{-3}. | 16371 | 4, 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 | |||
| 16388 | rounds to the nearest integer. When the fractional part is .5 exactly, | 16382 | rounds to the nearest integer. When the fractional part is .5 exactly, |
| 16389 | this command rounds away from zero. (All other rounding in the | 16383 | this command rounds away from zero. (All other rounding in the |
| 16390 | Calculator uses this convention as well.) Thus @kbd{3.5 R} produces 4 | 16384 | Calculator uses this convention as well.) Thus @kbd{3.5 R} produces 4 |
| 16391 | but @kbd{3.4 R} produces 3; @kbd{_3.5 R} produces @i{-4}. | 16385 | but @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}. | |||
| 16401 | The @kbd{I R} (@code{calc-trunc}) [@code{trunc} or @code{ftrunc}] | 16395 | The @kbd{I R} (@code{calc-trunc}) [@code{trunc} or @code{ftrunc}] |
| 16402 | command truncates toward zero. In other words, it ``chops off'' | 16396 | command truncates toward zero. In other words, it ``chops off'' |
| 16403 | everything after the decimal point. Thus @kbd{3.6 I R} produces 3 and | 16397 | everything 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 | ||
| 16406 | These functions may not be applied meaningfully to error forms, but they | 16400 | These functions may not be applied meaningfully to error forms, but they |
| 16407 | do work for intervals. As a convenience, applying @code{floor} to a | 16401 | do work for intervals. As a convenience, applying @code{floor} to a |
| @@ -16479,17 +16473,17 @@ this command replaces each element by its complex conjugate. | |||
| 16479 | The @kbd{G} (@code{calc-argument}) [@code{arg}] command computes the | 16473 | The @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 |
| 16481 | notation, this is simply the second component of the pair | 16475 | notation, 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{)}'. |
| 16484 | The result is expressed according to the current angular mode and will | 16478 | The result is expressed according to the current angular mode and will |
| 16485 | be in the range @i{-180} degrees (exclusive) to @i{+180} degrees | 16479 | be 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 |
| 16489 | The @code{calc-imaginary} command multiplies the number on the | 16483 | The @code{calc-imaginary} command multiplies the number on the |
| 16490 | top of the stack by the imaginary number @expr{i = (0,1)}. This | 16484 | top of the stack by the imaginary number @expr{i = (0,1)}. This |
| 16491 | command is not normally bound to a key in Calc, but it is available | 16485 | command is not normally bound to a key in Calc, but it is available |
| 16492 | on the @key{IMAG} button in Keypad Mode. | 16486 | on 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 |
| 16514 | The @kbd{v p} (@code{calc-pack}) command can pack the top two numbers on | 16508 | The @kbd{v p} (@code{calc-pack}) command can pack the top two numbers on |
| 16515 | the stack into a composite object such as a complex number. With | 16509 | the stack into a composite object such as a complex number. With |
| 16516 | a prefix argument of @i{-1}, it produces a rectangular complex number; | 16510 | a prefix argument of @mathit{-1}, it produces a rectangular complex number; |
| 16517 | with an argument of @i{-2}, it produces a polar complex number. | 16511 | with 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 | |||
| 16638 | The @kbd{c c} (@code{calc-clean}) [@code{pclean}] command ``cleans'' the | 16632 | The @kbd{c c} (@code{calc-clean}) [@code{pclean}] command ``cleans'' the |
| 16639 | number on the top of the stack. Floating point numbers are re-rounded | 16633 | number on the top of the stack. Floating point numbers are re-rounded |
| 16640 | according to the current precision. Polar numbers whose angular | 16634 | according to the current precision. Polar numbers whose angular |
| 16641 | components have strayed from the @i{-180} to @i{+180} degree range | 16635 | components have strayed from the @mathit{-180} to @mathit{+180} degree range |
| 16642 | are normalized. (Note that results will be undesirable if the current | 16636 | are normalized. (Note that results will be undesirable if the current |
| 16643 | angular mode is different from the one under which the number was | 16637 | angular mode is different from the one under which the number was |
| 16644 | produced!) Integers and fractions are generally unaffected by this | 16638 | produced!) 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 |
| 16896 | years). A prefix argument of 0 computes the last day of the | 16890 | years). A prefix argument of 0 computes the last day of the |
| 16897 | year (December 31). A negative prefix argument from @i{-1} to | 16891 | year (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 | |||
| 17264 | name of a function that is used to compute the daylight savings | 17258 | name of a function that is used to compute the daylight savings |
| 17265 | adjustment for a given date. The default is | 17259 | adjustment 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 | ||
| 17269 | The daylight savings hook function is called with four arguments: | 17263 | The daylight savings hook function is called with four arguments: |
| 17270 | The date, as a floating-point number in standard Calc format; | 17264 | The date, as a floating-point number in standard Calc format; |
| @@ -17312,7 +17306,7 @@ daylight savings hook: | |||
| 17312 | @noindent | 17306 | @noindent |
| 17313 | The @code{bump} parameter is equal to zero when Calc is converting | 17307 | The @code{bump} parameter is equal to zero when Calc is converting |
| 17314 | from a date form in a generalized time zone into a GMT date value. | 17308 | from a date form in a generalized time zone into a GMT date value. |
| 17315 | It is @i{-1} when Calc is converting in the other direction. The | 17309 | It is @mathit{-1} when Calc is converting in the other direction. The |
| 17316 | adjustments shown above ensure that the conversion behaves correctly | 17310 | adjustments shown above ensure that the conversion behaves correctly |
| 17317 | and reasonably around the 2 a.m.@: transition in each direction. | 17311 | and 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 "} | |||
| 17768 | integrals or solving equations involving the functions. | 17762 | integrals or solving equations involving the functions. |
| 17769 | 17763 | ||
| 17770 | @ifinfo | 17764 | @ifinfo |
| 17771 | These formulas are shown using the conventions of ``Big'' display | 17765 | These formulas are shown using the conventions of Big display |
| 17772 | mode (@kbd{d B}); for example, the formula for @code{fv} written | 17766 | mode (@kbd{d B}); for example, the formula for @code{fv} written |
| 17773 | linearly is @samp{pmt * ((1 + rate)^n) - 1) / rate}. | 17767 | linearly 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 | ||
| 17940 | If the word size is negative, binary operations produce 2's complement | 17934 | If the word size is negative, binary operations produce 2's complement |
| 17941 | integers from | 17935 | integers 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))} |
| 17944 | to | 17938 | to |
| 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} |
| 17947 | inclusive. Either mode accepts inputs in any range; the sign of | 17941 | inclusive. 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 | |||
| 17958 | generally is not ``binary.'' (However, @pxref{Simplification Modes}, | 17952 | generally 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 |
| 17960 | bits @kbd{b c} converts a number to the range 0 to 255; with a word | 17954 | bits @kbd{b c} converts a number to the range 0 to 255; with a word |
| 17961 | size of @i{-8} @kbd{b c} converts to the range @i{-128} to 127. | 17955 | size 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 | |||
| 17974 | optional second (or third) word-size parameter. When a formula like | 17968 | optional 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 |
| 17976 | will be used, but when @samp{and(a,b,-8)} is evaluated, a word size of | 17970 | will 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 |
| 17978 | in symbolic form unless the all of its argument(s) are integers or | 17972 | in symbolic form unless the all of its argument(s) are integers or |
| 17979 | integer-valued floats. | 17973 | integer-valued floats. |
| 17980 | 17974 | ||
| @@ -18126,11 +18120,11 @@ One miscellaneous command is shift-@kbd{P} (@code{calc-pi}), which pushes | |||
| 18126 | the value of @cpi{} (at the current precision) onto the stack. With the | 18120 | the value of @cpi{} (at the current precision) onto the stack. With the |
| 18127 | Hyperbolic flag, it pushes the value @expr{e}, the base of natural logarithms. | 18121 | Hyperbolic flag, it pushes the value @expr{e}, the base of natural logarithms. |
| 18128 | With the Inverse flag, it pushes Euler's constant | 18122 | With 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 |
| 18132 | pushes the ``golden ratio'' | 18126 | pushes 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 |
| 18136 | to unlimited precision; Calc knows only the first 100 digits.) | 18130 | to 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 | |||
| 18210 | it raises ten to a given power.) Note that the common logarithm of a | 18204 | it raises ten to a given power.) Note that the common logarithm of a |
| 18211 | complex number is computed by taking the natural logarithm and dividing | 18205 | complex number is computed by taking the natural logarithm and dividing |
| 18212 | by | 18206 | by |
| 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 |
| 18221 | The @kbd{B} (@code{calc-log}) [@code{log}] command computes a logarithm | 18215 | The @kbd{B} (@code{calc-log}) [@code{log}] command computes a logarithm |
| 18222 | to any base. For example, @kbd{1024 @key{RET} 2 B} produces 10, since | 18216 | to 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}. |
| 18225 | In certain cases like @samp{log(3,9)}, the result | 18219 | In certain cases like @samp{log(3,9)}, the result |
| 18226 | will be either @expr{1:2} or @expr{0.5} depending on the current Fraction | 18220 | will be either @expr{1:2} or @expr{0.5} depending on the current Fraction |
| 18227 | Mode setting. With the Inverse flag [@code{alog}], this command is | 18221 | mode setting. With the Inverse flag [@code{alog}], this command is |
| 18228 | similar to @kbd{^} except that the order of the arguments is reversed. | 18222 | similar 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 |
| 18244 | The @kbd{f E} (@code{calc-expm1}) [@code{expm1}] command computes | 18238 | The @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}, |
| 18247 | but using an algorithm that produces a more accurate | 18241 | but using an algorithm that produces a more accurate |
| 18248 | answer when the result is close to zero, i.e., when | 18242 | answer 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)} |
| 18251 | is close to one. | 18245 | is 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 |
| 18256 | The @kbd{f L} (@code{calc-lnp1}) [@code{lnp1}] command computes | 18250 | The @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)}, |
| 18259 | producing a more accurate answer when @expr{x} is close to zero. | 18253 | producing 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}. | |||
| 18280 | Also, the symbolic variable @code{pi} is not ordinarily recognized in | 18274 | Also, the symbolic variable @code{pi} is not ordinarily recognized in |
| 18281 | arguments to trigonometric functions, as in @samp{sin(3 pi / 4)}, but | 18275 | arguments to trigonometric functions, as in @samp{sin(3 pi / 4)}, but |
| 18282 | the @kbd{a s} (@code{calc-simplify}) command recognizes many such | 18276 | the @kbd{a s} (@code{calc-simplify}) command recognizes many such |
| 18283 | formulas when the current angular mode is radians @emph{and} symbolic | 18277 | formulas when the current angular mode is Radians @emph{and} Symbolic |
| 18284 | mode is enabled; this example would be replaced by @samp{sqrt(2) / 2}. | 18278 | mode 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 |
| 18286 | have stored a different value in the variable @samp{pi}; this is one | 18280 | have 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. | |||
| 18289 | Calc includes similar formulas for @code{cos} and @code{tan}. | 18283 | Calc includes similar formulas for @code{cos} and @code{tan}. |
| 18290 | 18284 | ||
| 18291 | The @kbd{a s} command knows all angles which are integer multiples of | 18285 | The @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, |
| 18293 | analogous simplifications occur for integer multiples of 15 or 18 | 18287 | analogous simplifications occur for integer multiples of 15 or 18 |
| 18294 | degrees, and for arguments plus multiples of 90 degrees. | 18288 | degrees, and for arguments plus multiples of 90 degrees. |
| 18295 | 18289 | ||
| @@ -18388,10 +18382,10 @@ variants of these functions. | |||
| 18388 | @tindex arctan2 | 18382 | @tindex arctan2 |
| 18389 | The @kbd{f T} (@code{calc-arctan2}) [@code{arctan2}] command takes two | 18383 | The @kbd{f T} (@code{calc-arctan2}) [@code{arctan2}] command takes two |
| 18390 | numbers from the stack and computes the arc tangent of their ratio. The | 18384 | numbers from the stack and computes the arc tangent of their ratio. The |
| 18391 | result is in the full range from @i{-180} (exclusive) to @i{+180} | 18385 | result 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 |
| 18393 | result would be obtained with @kbd{/} followed by @kbd{I T}, but the | 18387 | result would be obtained with @kbd{/} followed by @kbd{I T}, but the |
| 18394 | value would only be in the range from @i{-90} to @i{+90} degrees | 18388 | value would only be in the range from @mathit{-90} to @mathit{+90} degrees |
| 18395 | since the division loses information about the signs of the two | 18389 | since the division loses information about the signs of the two |
| 18396 | components, and an error might result from an explicit division by zero | 18390 | components, and an error might result from an explicit division by zero |
| 18397 | which @code{arctan2} would avoid. By (arbitrary) definition, | 18391 | which @code{arctan2} would avoid. By (arbitrary) definition, |
| @@ -18440,7 +18434,7 @@ gamma function. For positive integer arguments, this is related to the | |||
| 18440 | factorial function: @samp{gamma(n+1) = fact(n)}. For general complex | 18434 | factorial function: @samp{gamma(n+1) = fact(n)}. For general complex |
| 18441 | arguments the gamma function can be defined by the following definite | 18435 | arguments the gamma function can be defined by the following definite |
| 18442 | integral: | 18436 | integral: |
| 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: | |||
| 18474 | The @kbd{f G} (@code{calc-inc-gamma}) [@code{gammaP}] command computes | 18468 | The @kbd{f G} (@code{calc-inc-gamma}) [@code{gammaP}] command computes |
| 18475 | the incomplete gamma function, denoted @samp{P(a,x)}. This is defined by | 18469 | the incomplete gamma function, denoted @samp{P(a,x)}. This is defined by |
| 18476 | the integral, | 18470 | the 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)}. |
| 18479 | This implies that @samp{gammaP(a,inf) = 1} for any @expr{a} (see the | 18473 | This implies that @samp{gammaP(a,inf) = 1} for any @expr{a} (see the |
| 18480 | definition of the normal gamma function). | 18474 | definition 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 |
| 18508 | The @kbd{f b} (@code{calc-beta}) [@code{beta}] command computes the | 18502 | The @kbd{f b} (@code{calc-beta}) [@code{beta}] command computes the |
| 18509 | Euler beta function, which is defined in terms of the gamma function as | 18503 | Euler 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)}, |
| 18512 | or by | 18506 | or 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 |
| 18521 | The @kbd{f B} (@code{calc-inc-beta}) [@code{betaI}] command computes | 18515 | The @kbd{f B} (@code{calc-inc-beta}) [@code{betaI}] command computes |
| 18522 | the incomplete beta function @expr{I(x,a,b)}. It is defined by | 18516 | the 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)}. |
| 18525 | Once again, the @kbd{H} (hyperbolic) prefix gives the corresponding | 18519 | Once again, the @kbd{H} (hyperbolic) prefix gives the corresponding |
| 18526 | un-normalized version [@code{betaB}]. | 18520 | un-normalized version [@code{betaB}]. |
| @@ -18532,11 +18526,11 @@ un-normalized version [@code{betaB}]. | |||
| 18532 | @tindex erfc | 18526 | @tindex erfc |
| 18533 | The @kbd{f e} (@code{calc-erf}) [@code{erf}] command computes the | 18527 | The @kbd{f e} (@code{calc-erf}) [@code{erf}] command computes the |
| 18534 | error function | 18528 | error 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)}. |
| 18537 | The complementary error function @kbd{I f e} (@code{calc-erfc}) [@code{erfc}] | 18531 | The complementary error function @kbd{I f e} (@code{calc-erfc}) [@code{erfc}] |
| 18538 | is the corresponding integral from @samp{x} to infinity; the sum | 18532 | is 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 | ||
| 18613 | For @samp{z1^z2}: This is defined by @samp{exp(ln(z1)*z2)}. | 18607 | For @samp{z1^z2}: This is defined by @samp{exp(ln(z1)*z2)}. |
| 18614 | One interesting consequence of this is that @samp{(-8)^1:3} does | 18608 | One interesting consequence of this is that @samp{(-8)^1:3} does |
| 18615 | not evaluate to @i{-2} as you might expect, but to the complex | 18609 | not evaluate to @mathit{-2} as you might expect, but to the complex |
| 18616 | number @expr{(1., 1.732)}. Both of these are valid cube roots | 18610 | number @expr{(1., 1.732)}. Both of these are valid cube roots |
| 18617 | of @i{-8} (as is @expr{(1., -1.732)}); Calc chooses a perhaps | 18611 | of @mathit{-8} (as is @expr{(1., -1.732)}); Calc chooses a perhaps |
| 18618 | less-obvious root for the sake of mathematical consistency. | 18612 | less-obvious root for the sake of mathematical consistency. |
| 18619 | 18613 | ||
| 18620 | For @samp{arcsin(z)}: This is defined by @samp{-i*ln(i*z + sqrt(1-z^2))}. | 18614 | For @samp{arcsin(z)}: This is defined by @samp{-i*ln(i*z + sqrt(1-z^2))}. |
| 18621 | The branch cuts are on the real axis, less than @i{-1} and greater than 1. | 18615 | The branch cuts are on the real axis, less than @mathit{-1} and greater than 1. |
| 18622 | 18616 | ||
| 18623 | For @samp{arccos(z)}: This is defined by @samp{-i*ln(z + i*sqrt(1-z^2))}, | 18617 | For @samp{arccos(z)}: This is defined by @samp{-i*ln(z + i*sqrt(1-z^2))}, |
| 18624 | or equivalently by @samp{pi/2 - arcsin(z)}. The branch cuts are on | 18618 | or equivalently by @samp{pi/2 - arcsin(z)}. The branch cuts are on |
| 18625 | the real axis, less than @i{-1} and greater than 1. | 18619 | the real axis, less than @mathit{-1} and greater than 1. |
| 18626 | 18620 | ||
| 18627 | For @samp{arctan(z)}: This is defined by | 18621 | For @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 | |||
| 18637 | real axis less than 1. | 18631 | real axis less than 1. |
| 18638 | 18632 | ||
| 18639 | For @samp{arctanh(z)}: This is defined by @samp{(ln(1+z) - ln(1-z)) / 2}. | 18633 | For @samp{arctanh(z)}: This is defined by @samp{(ln(1+z) - ln(1-z)) / 2}. |
| 18640 | The branch cuts are on the real axis, less than @i{-1} and greater than 1. | 18634 | The branch cuts are on the real axis, less than @mathit{-1} and greater than 1. |
| 18641 | 18635 | ||
| 18642 | The following tables for @code{arcsin}, @code{arccos}, and | 18636 | The 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 |
| 18644 | hyperbolic functions operate independently of the angular mode. | 18638 | hyperbolic functions operate independently of the angular mode. |
| 18645 | 18639 | ||
| 18646 | @smallexample | 18640 | @smallexample |
| @@ -18710,7 +18704,7 @@ random numbers of various sorts. | |||
| 18710 | 18704 | ||
| 18711 | Given a positive numeric prefix argument @expr{M}, it produces a random | 18705 | Given a positive numeric prefix argument @expr{M}, it produces a random |
| 18712 | integer @expr{N} in the range | 18706 | integer @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}. |
| 18715 | Each of the @expr{M} values appears with equal probability. | 18709 | Each 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 | |||
| 18720 | while numeric prefix arguments are limited to six digits or so, an @expr{M} | 18714 | while numeric prefix arguments are limited to six digits or so, an @expr{M} |
| 18721 | taken from the stack can be arbitrarily large. If @expr{M} is negative, | 18715 | taken from the stack can be arbitrarily large. If @expr{M} is negative, |
| 18722 | the result is a random integer in the range | 18716 | the 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 | ||
| 18726 | If the value on the stack is a floating-point number @expr{M}, the result | 18720 | If the value on the stack is a floating-point number @expr{M}, the result |
| 18727 | is a random floating-point number @expr{N} in the range | 18721 | is 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} |
| 18730 | or | 18724 | or |
| 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}, |
| 18733 | according to the sign of @expr{M}. | 18727 | according to the sign of @expr{M}. |
| 18734 | 18728 | ||
| @@ -18738,14 +18732,14 @@ of one. The algorithm used generates random numbers in pairs; thus, | |||
| 18738 | every other call to this function will be especially fast. | 18732 | every other call to this function will be especially fast. |
| 18739 | 18733 | ||
| 18740 | If @expr{M} is an error form | 18734 | If @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} |
| 18743 | where @var{m} and | 18737 | where @var{m} and |
| 18744 | @texline @tmath{\sigma} | 18738 | @texline @math{\sigma} |
| 18745 | @infoline @var{s} | 18739 | @infoline @var{s} |
| 18746 | are both real numbers, the result uses a Gaussian distribution with mean | 18740 | are 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 | ||
| 18751 | If @expr{M} is an interval form, the lower and upper bounds specify the | 18745 | If @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}. | |||
| 18858 | If @code{RandSeed} contains an integer, Calc uses this integer to | 18852 | If @code{RandSeed} contains an integer, Calc uses this integer to |
| 18859 | seed an ``additive congruential'' method (Knuth's algorithm 3.2.2A, | 18853 | seed an ``additive congruential'' method (Knuth's algorithm 3.2.2A, |
| 18860 | computing | 18854 | computing |
| 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}). |
| 18863 | This method expands the seed | 18857 | This method expands the seed |
| 18864 | value into a large table which is maintained internally; the variable | 18858 | value into a large table which is maintained internally; the variable |
| @@ -18894,20 +18888,20 @@ value. | |||
| 18894 | 18888 | ||
| 18895 | To create a random floating-point number with precision @var{p}, Calc | 18889 | To create a random floating-point number with precision @var{p}, Calc |
| 18896 | simply creates a random @var{p}-digit integer and multiplies by | 18890 | simply 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}. |
| 18899 | The resulting random numbers should be very clean, but note | 18893 | The resulting random numbers should be very clean, but note |
| 18900 | that relatively small numbers will have few significant random digits. | 18894 | that relatively small numbers will have few significant random digits. |
| 18901 | In other words, with a precision of 12, you will occasionally get | 18895 | In other words, with a precision of 12, you will occasionally get |
| 18902 | numbers on the order of | 18896 | numbers on the order of |
| 18903 | @texline @tmath{10^{-9}} | 18897 | @texline @math{10^{-9}} |
| 18904 | @infoline @expr{10^-9} | 18898 | @infoline @expr{10^-9} |
| 18905 | or | 18899 | or |
| 18906 | @texline @tmath{10^{-10}}, | 18900 | @texline @math{10^{-10}}, |
| 18907 | @infoline @expr{10^-10}, | 18901 | @infoline @expr{10^-10}, |
| 18908 | but those numbers will only have two or three random digits since they | 18902 | but those numbers will only have two or three random digits since they |
| 18909 | correspond to small integers times | 18903 | correspond 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 | ||
| 18913 | To create a random integer in the interval @samp{[0 .. @var{m})}, Calc | 18907 | To create a random integer in the interval @samp{[0 .. @var{m})}, Calc |
| @@ -18958,7 +18952,7 @@ numbers. | |||
| 18958 | The @kbd{k E} (@code{calc-extended-gcd}) [@code{egcd}] command computes | 18952 | The @kbd{k E} (@code{calc-extended-gcd}) [@code{egcd}] command computes |
| 18959 | the GCD of two integers @expr{x} and @expr{y} and returns a vector | 18953 | the 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 | |||
| 19002 | are integers, the result is an exact integer. Otherwise, the result is a | 18996 | are integers, the result is an exact integer. Otherwise, the result is a |
| 19003 | floating-point approximation. The binomial coefficient is defined for all | 18997 | floating-point approximation. The binomial coefficient is defined for all |
| 19004 | real numbers by | 18998 | real 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 |
| 19046 | The @kbd{k s} (@code{calc-stirling-number}) [@code{stir1}] command | 19040 | The @kbd{k s} (@code{calc-stirling-number}) [@code{stir1}] command |
| 19047 | computes a Stirling number of the first | 19041 | computes 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, |
| 19050 | given two integers @expr{n} and @expr{m} on the stack. The @kbd{H k s} | 19044 | given 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. |
| 19054 | These are the number of @expr{m}-cycle permutations of @expr{n} objects, | 19048 | These are the number of @expr{m}-cycle permutations of @expr{n} objects, |
| 19055 | and the number of ways to partition @expr{n} objects into @expr{m} | 19049 | and 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 | |||
| 19093 | inputs, prime factors above 5000 may not be found, in which case the | 19087 | inputs, prime factors above 5000 may not be found, in which case the |
| 19094 | last number in the vector will be an unfactored integer greater than 25 | 19088 | last number in the vector will be an unfactored integer greater than 25 |
| 19095 | million (with a warning message). For negative integers, the first | 19089 | million (with a warning message). For negative integers, the first |
| 19096 | element of the list will be @i{-1}. For inputs @i{-1}, @i{0}, and | 19090 | element 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 |
| 19129 | The @kbd{k t} (@code{calc-totient}) [@code{totient}] command computes the | 19123 | The @kbd{k t} (@code{calc-totient}) [@code{totient}] command computes the |
| 19130 | Euler ``totient'' | 19124 | Euler ``totient'' |
| 19131 | @texline function@tie{}@tmath{\phi(n)}, | 19125 | @texline function@tie{}@math{\phi(n)}, |
| 19132 | @infoline function, | 19126 | @infoline function, |
| 19133 | the number of integers less than @expr{n} which | 19127 | the number of integers less than @expr{n} which |
| 19134 | are relatively prime to @expr{n}. | 19128 | are 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 |
| 19139 | The @kbd{k m} (@code{calc-moebius}) [@code{moebius}] command computes the | 19133 | The @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'' |
| 19142 | function. If the input number is a product of @expr{k} | 19136 | function. If the input number is a product of @expr{k} |
| 19143 | distinct factors, this is @expr{(-1)^k}. If the input number has any | 19137 | distinct 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 |
| 19203 | The @samp{utpc(x,v)} function uses the chi-square distribution with | 19197 | The @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} |
| 19206 | degrees of freedom. It is the probability that a model is | 19200 | degrees of freedom. It is the probability that a model is |
| 19207 | correct if its chi-square statistic is @expr{x}. | 19201 | correct 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 |
| 19220 | The @samp{utpf(F,v1,v2)} function uses the F distribution, used in | 19214 | The @samp{utpf(F,v1,v2)} function uses the F distribution, used in |
| 19221 | various statistical tests. The parameters | 19215 | various statistical tests. The parameters |
| 19222 | @texline @tmath{\nu_1} | 19216 | @texline @math{\nu_1} |
| 19223 | @infoline @expr{v1} | 19217 | @infoline @expr{v1} |
| 19224 | and | 19218 | and |
| 19225 | @texline @tmath{\nu_2} | 19219 | @texline @math{\nu_2} |
| 19226 | @infoline @expr{v2} | 19220 | @infoline @expr{v2} |
| 19227 | are the degrees of freedom in the numerator and denominator, | 19221 | are the degrees of freedom in the numerator and denominator, |
| 19228 | respectively, used in computing the statistic @expr{F}. | 19222 | respectively, 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 |
| 19241 | The @samp{utpn(x,m,s)} function uses a normal (Gaussian) distribution | 19235 | The @samp{utpn(x,m,s)} function uses a normal (Gaussian) distribution |
| 19242 | with mean @expr{m} and standard deviation | 19236 | with mean @expr{m} and standard deviation |
| 19243 | @texline @tmath{\sigma}. | 19237 | @texline @math{\sigma}. |
| 19244 | @infoline @expr{s}. | 19238 | @infoline @expr{s}. |
| 19245 | It is the probability that such a normal-distributed random variable | 19239 | It is the probability that such a normal-distributed random variable |
| 19246 | would exceed @expr{x}. | 19240 | would exceed @expr{x}. |
| @@ -19273,18 +19267,18 @@ Poisson random events will occur. | |||
| 19273 | @tindex ltpt | 19267 | @tindex ltpt |
| 19274 | The @samp{utpt(t,v)} function uses the Student's ``t'' distribution | 19268 | The @samp{utpt(t,v)} function uses the Student's ``t'' distribution |
| 19275 | with | 19269 | with |
| 19276 | @texline @tmath{\nu} | 19270 | @texline @math{\nu} |
| 19277 | @infoline @expr{v} | 19271 | @infoline @expr{v} |
| 19278 | degrees of freedom. It is the probability that a | 19272 | degrees of freedom. It is the probability that a |
| 19279 | t-distributed random variable will be greater than @expr{t}. | 19273 | t-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)} |
| 19283 | where | 19277 | where |
| 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} |
| 19286 | and | 19280 | and |
| 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}. |
| 19289 | The @code{UTPT} operation on the HP-48 uses a different definition which | 19283 | The @code{UTPT} operation on the HP-48 uses a different definition which |
| 19290 | returns half of Calc's value: @samp{UTPT(t,v) = .5*utpt(t,v)}.) | 19284 | returns 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 | |||
| 19404 | times ten to the power of the exponent. | 19398 | times ten to the power of the exponent. |
| 19405 | 19399 | ||
| 19406 | @item -12 | 19400 | @item -12 |
| 19407 | This is treated the same as @i{-11} by the @kbd{v p} command. | 19401 | This is treated the same as @mathit{-11} by the @kbd{v p} command. |
| 19408 | When unpacking, @i{-12} specifies that a floating-point mantissa | 19402 | When unpacking, @mathit{-12} specifies that a floating-point mantissa |
| 19409 | is desired. | 19403 | is 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]]}. | |||
| 19444 | If any elements of the vector are negative, other kinds of | 19438 | If any elements of the vector are negative, other kinds of |
| 19445 | packing are done at that level as described above. For | 19439 | packing are done at that level as described above. For |
| 19446 | example, @samp{[2, 3, -4]} takes 12 objects and creates a | 19440 | example, @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 |
| 19449 | matrix of error forms: @samp{[[a +/- b, c +/- d ... ]]}. | 19443 | matrix of error forms: @samp{[[a +/- b, c +/- d ... ]]}. |
| 19450 | Also, @samp{[-4, -10]} will convert four integers into an | 19444 | Also, @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 | ||
| 19484 | Note that the prefix argument can have an effect even when the input is | 19478 | Note that the prefix argument can have an effect even when the input is |
| 19485 | not a vector. For example, if the input is the number @i{-5}, then | 19479 | not 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} |
| 19487 | when viewed as a rectangular complex number); @kbd{C-u -2 v u} yields 5 | 19481 | when viewed as a rectangular complex number); @kbd{C-u -2 v u} yields 5 |
| 19488 | and 180 (assuming degrees mode); and @kbd{C-u -10 v u} yields @i{-5} | 19482 | and 180 (assuming Degrees mode); and @kbd{C-u -10 v u} yields @mathit{-5} |
| 19489 | and 1 (the numerator and denominator of @i{-5}, viewed as a rational | 19483 | and 1 (the numerator and denominator of @mathit{-5}, viewed as a rational |
| 19490 | number). Plain @kbd{v u} with this input would complain that the input | 19484 | number). Plain @kbd{v u} with this input would complain that the input |
| 19491 | is not a composite object. | 19485 | is not a composite object. |
| 19492 | 19486 | ||
| 19493 | Unpacking mode @i{-11} converts a float into an integer mantissa and | 19487 | Unpacking mode @mathit{-11} converts a float into an integer mantissa and |
| 19494 | an integer exponent, where the mantissa is not divisible by 10 | 19488 | an 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). |
| 19496 | Unpacking mode @i{-12} converts a float into a floating-point mantissa | 19490 | Unpacking mode @mathit{-12} converts a float into a floating-point mantissa |
| 19497 | and integer exponent, where the mantissa (for non-zero numbers) | 19491 | and integer exponent, where the mantissa (for non-zero numbers) |
| 19498 | is guaranteed to lie in the range [1 .. 10). In both cases, | 19492 | is guaranteed to lie in the range [1 .. 10). In both cases, |
| 19499 | the mantissa is shifted left or right (and the exponent adjusted | 19493 | the 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 | |||
| 19593 | the prefix argument is required. | 19587 | the prefix argument is required. |
| 19594 | 19588 | ||
| 19595 | To build a constant square matrix, e.g., a | 19589 | To build a constant square matrix, e.g., a |
| 19596 | @texline @tmath{3\times3} | 19590 | @texline @math{3\times3} |
| 19597 | @infoline 3x3 | 19591 | @infoline 3x3 |
| 19598 | matrix filled with ones, use @kbd{0 M-3 v d 1 +}, i.e., build a zero | 19592 | matrix filled with ones, use @kbd{0 M-3 v d 1 +}, i.e., build a zero |
| 19599 | matrix first and then add a constant value to that matrix. (Another | 19593 | matrix 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 | |||
| 19615 | whose size is known, it is converted automatically to an identity | 19609 | whose size is known, it is converted automatically to an identity |
| 19616 | matrix of a suitable matching size. The @kbd{v i} command with an | 19610 | matrix of a suitable matching size. The @kbd{v i} command with an |
| 19617 | argument of zero creates a generic identity matrix, @samp{idn(1)}. | 19611 | argument of zero creates a generic identity matrix, @samp{idn(1)}. |
| 19618 | Note that in dimensioned matrix mode (@pxref{Matrix Mode}), generic | 19612 | Note that in dimensioned Matrix mode (@pxref{Matrix Mode}), generic |
| 19619 | identity matrices are immediately expanded to the current default | 19613 | identity matrices are immediately expanded to the current default |
| 19620 | dimensions. | 19614 | dimensions. |
| 19621 | 19615 | ||
| @@ -19626,7 +19620,7 @@ The @kbd{v x} (@code{calc-index}) [@code{index}] function builds a vector | |||
| 19626 | of consecutive integers from 1 to @var{n}, where @var{n} is the numeric | 19620 | of consecutive integers from 1 to @var{n}, where @var{n} is the numeric |
| 19627 | prefix argument. If you do not provide a prefix argument, you will be | 19621 | prefix argument. If you do not provide a prefix argument, you will be |
| 19628 | prompted to enter a suitable number. If @var{n} is negative, the result | 19622 | prompted to enter a suitable number. If @var{n} is negative, the result |
| 19629 | is a vector of negative integers from @var{n} to @i{-1}. | 19623 | is a vector of negative integers from @var{n} to @mathit{-1}. |
| 19630 | 19624 | ||
| 19631 | With a prefix argument of just @kbd{C-u}, the @kbd{v x} command takes | 19625 | With a prefix argument of just @kbd{C-u}, the @kbd{v x} command takes |
| 19632 | three values from the stack: @var{n}, @var{start}, and @var{incr} (with | 19626 | three 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 | |||
| 19819 | of the dimensions of a vector, matrix, or higher-order object. For | 19813 | of the dimensions of a vector, matrix, or higher-order object. For |
| 19820 | example, @samp{mdims([[a,b,c],[d,e,f]])} returns @samp{[2, 3]} since | 19814 | example, @samp{mdims([[a,b,c],[d,e,f]])} returns @samp{[2, 3]} since |
| 19821 | its argument is a | 19815 | its argument is a |
| 19822 | @texline @tmath{2\times3} | 19816 | @texline @math{2\times3} |
| 19823 | @infoline 2x3 | 19817 | @infoline 2x3 |
| 19824 | matrix. | 19818 | matrix. |
| 19825 | 19819 | ||
| @@ -19851,13 +19845,13 @@ in the vector, the last row will be short and the result will not be | |||
| 19851 | suitable for use as a matrix. For example, with the matrix | 19845 | suitable 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 |
| 19856 | matrix), @kbd{v a 1} produces @samp{[[1], [2], [3], [4]]} (a | 19850 | matrix), @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 |
| 19859 | matrix), @kbd{v a 2} produces @samp{[[1, 2], [3, 4]]} (the original | 19853 | matrix), @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 |
| 19862 | matrix), @w{@kbd{v a 3}} produces @samp{[[1, 2, 3], [4]]} (not a | 19856 | matrix), @w{@kbd{v a 3}} produces @samp{[[1, 2, 3], [4]]} (not a |
| 19863 | matrix), and @kbd{v a 0} produces the flattened list | 19857 | matrix), 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 | |||
| 20177 | will be the empty vector @samp{[]}. Note that the characters @kbd{V} | 20171 | will be the empty vector @samp{[]}. Note that the characters @kbd{V} |
| 20178 | and @kbd{^} were chosen to be close to the conventional mathematical | 20172 | and @kbd{^} were chosen to be close to the conventional mathematical |
| 20179 | notation for set | 20173 | notation for set |
| 20180 | @texline union@tie{}(@tmath{A \cup B}) | 20174 | @texline union@tie{}(@math{A \cup B}) |
| 20181 | @infoline union | 20175 | @infoline union |
| 20182 | and | 20176 | and |
| 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 | |||
| 20289 | set of integers in the sense of @kbd{V F} (@code{vfloor}). Beware | 20283 | set of integers in the sense of @kbd{V F} (@code{vfloor}). Beware |
| 20290 | that a simple input like @samp{[100]} can result in a huge integer | 20284 | that a simple input like @samp{[100]} can result in a huge integer |
| 20291 | representation | 20285 | representation |
| 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. | |||
| 20401 | The @kbd{u M} (@code{calc-vector-mean}) [@code{vmean}] command | 20395 | The @kbd{u M} (@code{calc-vector-mean}) [@code{vmean}] command |
| 20402 | computes the average (arithmetic mean) of the data values. | 20396 | computes the average (arithmetic mean) of the data values. |
| 20403 | If the inputs are error forms | 20397 | If 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}, |
| 20406 | this is the weighted mean of the @expr{x} values with weights | 20400 | this 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 | ||
| 20417 | Note that a plain number can be considered an error form with | 20411 | Note that a plain number can be considered an error form with |
| 20418 | error | 20412 | error |
| 20419 | @texline @tmath{\sigma = 0}. | 20413 | @texline @math{\sigma = 0}. |
| 20420 | @infoline @expr{s = 0}. | 20414 | @infoline @expr{s = 0}. |
| 20421 | If the input to @kbd{u M} is a mixture of | 20415 | If the input to @kbd{u M} is a mixture of |
| 20422 | plain numbers and error forms, the result is the mean of the | 20416 | plain 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 |
| 20526 | The @kbd{u S} (@code{calc-vector-sdev}) [@code{vsdev}] command | 20520 | The @kbd{u S} (@code{calc-vector-sdev}) [@code{vsdev}] command |
| 20527 | computes the standard | 20521 | computes the standard |
| 20528 | @texline deviation@tie{}@tmath{\sigma} | 20522 | @texline deviation@tie{}@math{\sigma} |
| 20529 | @infoline deviation | 20523 | @infoline deviation |
| 20530 | of the data values. If the values are error forms, the errors are used | 20524 | of the data values. If the values are error forms, the errors are used |
| 20531 | as weights just as for @kbd{u M}. This is the @emph{sample} standard | 20525 | as 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 | |||
| 20541 | of a single error form is simply the error part. The standard deviation | 20535 | of a single error form is simply the error part. The standard deviation |
| 20542 | of a continuous interval happens to equal the difference between the | 20536 | of a continuous interval happens to equal the difference between the |
| 20543 | limits, divided by | 20537 | limits, divided by |
| 20544 | @texline @tmath{\sqrt{12}}. | 20538 | @texline @math{\sqrt{12}}. |
| 20545 | @infoline @expr{sqrt(12)}. | 20539 | @infoline @expr{sqrt(12)}. |
| 20546 | The standard deviation of an integer interval is the same as the | 20540 | The standard deviation of an integer interval is the same as the |
| 20547 | standard deviation of a vector of those integers. | 20541 | standard 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}] |
| 20580 | commands compute the variance of the data values. The variance | 20574 | commands compute the variance of the data values. The variance |
| 20581 | is the | 20575 | is the |
| 20582 | @texline square@tie{}@tmath{\sigma^2} | 20576 | @texline square@tie{}@math{\sigma^2} |
| 20583 | @infoline square | 20577 | @infoline square |
| 20584 | of the standard deviation, i.e., the sum of the | 20578 | of the standard deviation, i.e., the sum of the |
| 20585 | squares of the deviations of the data values from the mean. | 20579 | squares 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 | |||
| 20603 | way as by the single-variable statistical functions. Given a numeric | 20597 | way as by the single-variable statistical functions. Given a numeric |
| 20604 | prefix argument of 1, these functions instead take one object from | 20598 | prefix argument of 1, these functions instead take one object from |
| 20605 | the stack, which must be an | 20599 | the stack, which must be an |
| 20606 | @texline @tmath{N\times2} | 20600 | @texline @math{N\times2} |
| 20607 | @infoline Nx2 | 20601 | @infoline Nx2 |
| 20608 | matrix of data values. Once again, variable names can be used in place | 20602 | matrix of data values. Once again, variable names can be used in place |
| 20609 | of actual vectors and matrices. | 20603 | of actual vectors and matrices. |
| @@ -20861,7 +20855,7 @@ If any argument to @kbd{V M} is a matrix, the operator is normally mapped | |||
| 20861 | across all elements of the matrix. For example, given the matrix | 20855 | across 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 |
| 20863 | produce another | 20857 | produce another |
| 20864 | @texline @tmath{3\times2} | 20858 | @texline @math{3\times2} |
| 20865 | @infoline 3x2 | 20859 | @infoline 3x2 |
| 20866 | matrix, @expr{[[1, 2, 3], [4, 5, 6]]}. | 20860 | matrix, @expr{[[1, 2, 3], [4, 5, 6]]}. |
| 20867 | 20861 | ||
| @@ -21272,11 +21266,11 @@ for anything else'') prefix. | |||
| 21272 | using regular Emacs editing commands. | 21266 | using regular Emacs editing commands. |
| 21273 | 21267 | ||
| 21274 | When doing algebraic work, you may find several of the Calculator's | 21268 | When doing algebraic work, you may find several of the Calculator's |
| 21275 | modes to be helpful, including algebraic-simplification mode (@kbd{m A}) | 21269 | modes to be helpful, including Algebraic Simplification mode (@kbd{m A}) |
| 21276 | or no-simplification mode (@kbd{m O}), | 21270 | or No-Simplification mode (@kbd{m O}), |
| 21277 | algebraic-entry mode (@kbd{m a}), fraction mode (@kbd{m f}), and | 21271 | Algebraic entry mode (@kbd{m a}), Fraction mode (@kbd{m f}), and |
| 21278 | symbolic mode (@kbd{m s}). @xref{Mode Settings}, for discussions | 21272 | Symbolic mode (@kbd{m s}). @xref{Mode Settings}, for discussions |
| 21279 | of these modes. You may also wish to select ``big'' display mode (@kbd{d B}). | 21273 | of 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 | |||
| 21330 | highlight the smallest portion of the formula that contains that | 21324 | highlight the smallest portion of the formula that contains that |
| 21331 | character. By default the sub-formula is highlighted by blanking out | 21325 | character. By default the sub-formula is highlighted by blanking out |
| 21332 | all of the rest of the formula with dots. Selection works in any | 21326 | all of the rest of the formula with dots. Selection works in any |
| 21333 | display mode but is perhaps easiest in ``big'' (@kbd{d B}) mode. | 21327 | display mode but is perhaps easiest in Big mode (@kbd{d B}). |
| 21334 | Suppose you enter the following formula: | 21328 | Suppose you enter the following formula: |
| 21335 | 21329 | ||
| 21336 | @smallexample | 21330 | @smallexample |
| @@ -21360,7 +21354,7 @@ to | |||
| 21360 | Every character not part of the sub-formula @samp{b} has been changed | 21354 | Every character not part of the sub-formula @samp{b} has been changed |
| 21361 | to a dot. The @samp{*} next to the line number is to remind you that | 21355 | to a dot. The @samp{*} next to the line number is to remind you that |
| 21362 | the formula has a portion of it selected. (In this case, it's very | 21356 | the formula has a portion of it selected. (In this case, it's very |
| 21363 | obvious, but it might not always be. If Embedded Mode is enabled, | 21357 | obvious, but it might not always be. If Embedded mode is enabled, |
| 21364 | the word @samp{Sel} also appears in the mode line because the stack | 21358 | the word @samp{Sel} also appears in the mode line because the stack |
| 21365 | may not be visible. @pxref{Embedded Mode}.) | 21359 | may not be visible. @pxref{Embedded Mode}.) |
| 21366 | 21360 | ||
| @@ -22010,17 +22004,17 @@ but which also substitutes stored values for variables in the formula. | |||
| 22010 | Use @kbd{a v} if you want the variables to ignore their stored values. | 22004 | Use @kbd{a v} if you want the variables to ignore their stored values. |
| 22011 | 22005 | ||
| 22012 | If you give a numeric prefix argument of 2 to @kbd{a v}, it simplifies | 22006 | If you give a numeric prefix argument of 2 to @kbd{a v}, it simplifies |
| 22013 | as if in algebraic simplification mode. This is equivalent to typing | 22007 | as 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 |
| 22015 | of 3 or more, it uses extended simplification mode (@kbd{a e}). | 22009 | of 3 or more, it uses Extended Simplification mode (@kbd{a e}). |
| 22016 | 22010 | ||
| 22017 | If you give a negative prefix argument @i{-1}, @i{-2}, or @i{-3}, | 22011 | If you give a negative prefix argument @mathit{-1}, @mathit{-2}, or @mathit{-3}, |
| 22018 | it simplifies in the corresponding mode but only works on the top-level | 22012 | it simplifies in the corresponding mode but only works on the top-level |
| 22019 | function call of the formula. For example, @samp{(2 + 3) * (2 + 3)} will | 22013 | function call of the formula. For example, @samp{(2 + 3) * (2 + 3)} will |
| 22020 | simplify to @samp{(2 + 3)^2}, without simplifying the sub-formulas | 22014 | simplify 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])} |
| 22023 | in no-simplify mode. Using @kbd{a v} will evaluate this all the way to | 22017 | in No-Simplify mode. Using @kbd{a v} will evaluate this all the way to |
| 22024 | 10; using @kbd{C-u - a v} will evaluate it only to @samp{1 + 2 + 3 + 4}. | 22018 | 10; 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 |
| 22029 | The @kbd{=} command corresponds to the @code{evalv} function, and | 22023 | The @kbd{=} command corresponds to the @code{evalv} function, and |
| 22030 | the related @kbd{N} command, which is like @kbd{=} but temporarily | 22024 | the related @kbd{N} command, which is like @kbd{=} but temporarily |
| 22031 | disables symbolic (@kbd{m s}) mode during the evaluation, corresponds | 22025 | disables Symbolic mode (@kbd{m s}) during the evaluation, corresponds |
| 22032 | to the @code{evalvn} function. (These commands interpret their prefix | 22026 | to the @code{evalvn} function. (These commands interpret their prefix |
| 22033 | arguments differently than @kbd{a v}; @kbd{=} treats the prefix as | 22027 | arguments differently than @kbd{a v}; @kbd{=} treats the prefix as |
| 22034 | the number of stack elements to evaluate at once, and @kbd{N} treats | 22028 | the 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 | |||
| 22203 | to a function are somehow of the wrong type @expr{@t{tan}([2,3,4])}), | 22197 | to a function are somehow of the wrong type @expr{@t{tan}([2,3,4])}), |
| 22204 | range (@expr{@t{tan}(90)}), or number (@expr{@t{tan}(3,5)}), | 22198 | range (@expr{@t{tan}(90)}), or number (@expr{@t{tan}(3,5)}), |
| 22205 | or if the function name is not recognized (@expr{@t{f}(5)}), or if | 22199 | or if the function name is not recognized (@expr{@t{f}(5)}), or if |
| 22206 | ``symbolic'' mode (@pxref{Symbolic Mode}) prevents evaluation | 22200 | Symbolic mode (@pxref{Symbolic Mode}) prevents evaluation |
| 22207 | (@expr{@t{sqrt}(2)}). | 22201 | (@expr{@t{sqrt}(2)}). |
| 22208 | 22202 | ||
| 22209 | Calc simplifies (evaluates) the arguments to a function before it | 22203 | Calc simplifies (evaluates) the arguments to a function before it |
| @@ -22286,7 +22280,7 @@ simplifications.) | |||
| 22286 | 22280 | ||
| 22287 | The distributive law is used to simplify sums in some cases: | 22281 | The 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 |
| 22289 | a number or an implicit 1 or @i{-1} (as in @expr{x} or @expr{-x}) | 22283 | a number or an implicit 1 or @mathit{-1} (as in @expr{x} or @expr{-x}) |
| 22290 | and similarly for @expr{b}. Use the @kbd{a c}, @w{@kbd{a f}}, or | 22284 | and 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 |
| 22292 | using the distributive law. | 22286 | using the distributive law. |
| @@ -22311,7 +22305,7 @@ to @expr{-a}. | |||
| 22311 | The products @expr{1 a} and @expr{a 1} are simplified to @expr{a}; | 22305 | The 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 |
| 22314 | in matrix mode where @expr{a} is not provably scalar the result | 22308 | in Matrix mode where @expr{a} is not provably scalar the result |
| 22315 | is the generic zero matrix @samp{idn(0)}, and that if @expr{a} is | 22309 | is the generic zero matrix @samp{idn(0)}, and that if @expr{a} is |
| 22316 | infinite the result is @samp{nan}. | 22310 | infinite the result is @samp{nan}. |
| 22317 | 22311 | ||
| @@ -22330,25 +22324,25 @@ rewritten to @expr{a (c - b)}. | |||
| 22330 | 22324 | ||
| 22331 | The distributive law of products and powers is used for adjacent | 22325 | The distributive law of products and powers is used for adjacent |
| 22332 | terms of the product: @expr{x^a x^b} goes to | 22326 | terms 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)} |
| 22335 | where @expr{a} is a number, or an implicit 1 (as in @expr{x}), | 22329 | where @expr{a} is a number, or an implicit 1 (as in @expr{x}), |
| 22336 | or the implicit one-half of @expr{@t{sqrt}(x)}, and similarly for | 22330 | or 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} |
| 22338 | if the sum of the powers is @expr{1/2} or @expr{-1/2}, respectively. | 22332 | if the sum of the powers is @expr{1/2} or @expr{-1/2}, respectively. |
| 22339 | If the sum of the powers is zero, the product is simplified to | 22333 | If 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 | ||
| 22342 | The product of a negative power times anything but another negative | 22336 | The product of a negative power times anything but another negative |
| 22343 | power is changed to use division: | 22337 | power 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} |
| 22346 | goes to @expr{y / x^2} unless matrix mode is | 22340 | goes to @expr{y / x^2} unless Matrix mode is |
| 22347 | in effect and neither @expr{x} nor @expr{y} are scalar (in which | 22341 | in effect and neither @expr{x} nor @expr{y} are scalar (in which |
| 22348 | case it is considered unsafe to rearrange the order of the terms). | 22342 | case it is considered unsafe to rearrange the order of the terms). |
| 22349 | 22343 | ||
| 22350 | Finally, @expr{a (b/c)} is rewritten to @expr{(a b)/c}, and also | 22344 | Finally, @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 | ||
| 22367 | The expression | 22361 | The 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)} |
| 22370 | is changed to @expr{a b^c}, where @expr{-c} is any negative-looking | 22364 | is changed to @expr{a b^c}, where @expr{-c} is any negative-looking |
| 22371 | power. Also, @expr{1 / b^c} is changed to | 22365 | power. 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)} |
| 22374 | for any power @expr{c}. | 22368 | for any power @expr{c}. |
| 22375 | 22369 | ||
| 22376 | Also, @expr{(-a) / b} and @expr{a / (-b)} go to @expr{-(a/b)}; | 22370 | Also, @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)} |
| 22378 | goes to @expr{(a c) / b} unless matrix mode prevents this | 22372 | goes to @expr{(a c) / b} unless Matrix mode prevents this |
| 22379 | rearrangement. Similarly, @expr{a / (b:c)} is simplified to | 22373 | rearrangement. 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 | ||
| 22401 | The formula @expr{x^0} is simplified to @expr{1}, or to @samp{idn(1)} | 22395 | The formula @expr{x^0} is simplified to @expr{1}, or to @samp{idn(1)} |
| 22402 | in matrix mode. The formula @expr{0^x} is simplified to @expr{0} | 22396 | in Matrix mode. The formula @expr{0^x} is simplified to @expr{0} |
| 22403 | unless @expr{x} is a negative number or complex number, in which | 22397 | unless @expr{x} is a negative number or complex number, in which |
| 22404 | case the result is an infinity or an unsimplified formula according | 22398 | case the result is an infinity or an unsimplified formula according |
| 22405 | to the current infinite mode. Note that @expr{0^0} is an | 22399 | to 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} | |||
| 22410 | are distributed to @expr{a^c b^c}, @expr{a^c / b^c} only if @expr{c} | 22404 | are distributed to @expr{a^c b^c}, @expr{a^c / b^c} only if @expr{c} |
| 22411 | is an integer, or if either @expr{a} or @expr{b} are nonnegative | 22405 | is an integer, or if either @expr{a} or @expr{b} are nonnegative |
| 22412 | real numbers. Powers of powers @expr{(a^b)^c} are simplified to | 22406 | real 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)} |
| 22415 | only when @expr{c} is an integer and @expr{b c} also | 22409 | only when @expr{c} is an integer and @expr{b c} also |
| 22416 | evaluates to an integer. Without these restrictions these simplifications | 22410 | evaluates to an integer. Without these restrictions these simplifications |
| 22417 | would not be safe because of problems with principal values. | 22411 | would 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} |
| 22421 | is safe to simplify, but | 22415 | is 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} |
| 22424 | is not.) @xref{Declarations}, for ways to inform Calc that your | 22418 | is not.) @xref{Declarations}, for ways to inform Calc that your |
| 22425 | variables satisfy these requirements. | 22419 | variables satisfy these requirements. |
| 22426 | 22420 | ||
| 22427 | As a special case of this rule, @expr{@t{sqrt}(x)^n} is simplified to | 22421 | As 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)} |
| 22430 | only for even integers @expr{n}. | 22424 | only 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, | |||
| 22438 | for any negative-looking expression @expr{-a}. | 22432 | for any negative-looking expression @expr{-a}. |
| 22439 | 22433 | ||
| 22440 | Square roots @expr{@t{sqrt}(x)} generally act like one-half powers | 22434 | Square 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} |
| 22443 | for the purposes of the above-listed simplifications. | 22437 | for the purposes of the above-listed simplifications. |
| 22444 | 22438 | ||
| 22445 | Also, note that | 22439 | Also, 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} |
| 22448 | is changed to | 22442 | is 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)}, |
| 22451 | but @expr{1 / @t{sqrt}(x)} is left alone. | 22445 | but @expr{1 / @t{sqrt}(x)} is left alone. |
| 22452 | 22446 | ||
| @@ -22575,7 +22569,7 @@ property that real-valued numbers, interval forms and infinities | |||
| 22575 | come first, and are sorted into increasing order. The @kbd{V S} | 22569 | come first, and are sorted into increasing order. The @kbd{V S} |
| 22576 | command uses the same ordering when sorting a vector. | 22570 | command uses the same ordering when sorting a vector. |
| 22577 | 22571 | ||
| 22578 | Sorting of terms of products is inhibited when matrix mode is | 22572 | Sorting of terms of products is inhibited when Matrix mode is |
| 22579 | turned on; in this case, Calc will never exchange the order of | 22573 | turned on; in this case, Calc will never exchange the order of |
| 22580 | two terms unless it knows at least one of the terms is a scalar. | 22574 | two 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}. | |||
| 22589 | A subtle point is that @expr{(x - y) (y - x)} will @emph{not} | 22583 | A subtle point is that @expr{(x - y) (y - x)} will @emph{not} |
| 22590 | be simplified to @expr{-(x - y)^2}; Calc does not notice that | 22584 | be simplified to @expr{-(x - y)^2}; Calc does not notice that |
| 22591 | one term can be written as a constant times the other, even if | 22585 | one term can be written as a constant times the other, even if |
| 22592 | that constant is @i{-1}. | 22586 | that constant is @mathit{-1}. |
| 22593 | 22587 | ||
| 22594 | A fraction times any expression, @expr{(a:b) x}, is changed to | 22588 | A fraction times any expression, @expr{(a:b) x}, is changed to |
| 22595 | a quotient involving integers: @expr{a x / b}. This is not | 22589 | a quotient involving integers: @expr{a x / b}. This is not |
| @@ -22632,7 +22626,7 @@ Square roots of integer or rational arguments are simplified in | |||
| 22632 | several ways. (Note that these will be left unevaluated only in | 22626 | several ways. (Note that these will be left unevaluated only in |
| 22633 | Symbolic mode.) First, square integer or rational factors are | 22627 | Symbolic mode.) First, square integer or rational factors are |
| 22634 | pulled out so that @expr{@t{sqrt}(8)} is rewritten as | 22628 | pulled 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)}. |
| 22637 | Conceptually speaking this implies factoring the argument into primes | 22631 | Conceptually speaking this implies factoring the argument into primes |
| 22638 | and moving pairs of primes out of the square root, but for reasons of | 22632 | and 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} |
| 22699 | radians or 360 degrees. However, @expr{@t{arcsinh}(@t{sinh}(x))} is | 22693 | radians or 360 degrees. However, @expr{@t{arcsinh}(@t{sinh}(x))} is |
| 22700 | simplified to @expr{x} if @expr{x} is known to be real. | 22694 | simplified to @expr{x} if @expr{x} is known to be real. |
| 22701 | 22695 | ||
| 22702 | Several simplifications that apply to logarithms and exponentials | 22696 | Several simplifications that apply to logarithms and exponentials |
| 22703 | are that @expr{@t{exp}(@t{ln}(x))}, | 22697 | are 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)}, |
| 22706 | and | 22700 | and |
| 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)} |
| 22709 | all reduce to @expr{x}. Also, @expr{@t{ln}(@t{exp}(x))}, etc., can | 22703 | all reduce to @expr{x}. Also, @expr{@t{ln}(@t{exp}(x))}, etc., can |
| 22710 | reduce to @expr{x} if @expr{x} is provably real. The form | 22704 | reduce 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} |
| 22712 | is a suitable multiple of | 22706 | is 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 | |||
| 22795 | functions always produce. | 22789 | functions always produce. |
| 22796 | 22790 | ||
| 22797 | Powers of powers @expr{(x^a)^b} are simplified to | 22791 | Powers 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)} |
| 22800 | for all @expr{a} and @expr{b}. These results will be valid only | 22794 | for all @expr{a} and @expr{b}. These results will be valid only |
| 22801 | in a restricted range of @expr{x}; for example, in | 22795 | in 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} |
| 22804 | the powers cancel to get @expr{x}, which is valid for positive values | 22798 | the powers cancel to get @expr{x}, which is valid for positive values |
| 22805 | of @expr{x} but not for negative or complex values. | 22799 | of @expr{x} but not for negative or complex values. |
| 22806 | 22800 | ||
| 22807 | Similarly, @expr{@t{sqrt}(x^a)} and @expr{@t{sqrt}(x)^a} are both | 22801 | Similarly, @expr{@t{sqrt}(x^a)} and @expr{@t{sqrt}(x)^a} are both |
| 22808 | simplified (possibly unsafely) to | 22802 | simplified (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 | ||
| 22812 | Forms like @expr{@t{sqrt}(1 - sin(x)^2)} are simplified to, e.g., | 22806 | Forms 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. | |||
| 22882 | For powers and square roots, the ``unsafe'' simplifications | 22876 | For 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}, |
| 22884 | and @expr{(a^b)^c} to | 22878 | and @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)} |
| 22887 | are done if the powers are real numbers. (These are safe in the context | 22881 | are done if the powers are real numbers. (These are safe in the context |
| 22888 | of units because all numbers involved can reasonably be assumed to be | 22882 | of 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} | |||
| 22897 | is defined in terms of @samp{m^2}, and that the 2 in the power of | 22891 | is 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 |
| 22899 | replaced by approximately | 22893 | replaced 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}, |
| 22902 | which is then changed to | 22896 | which 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}, |
| 22905 | then to @expr{257440 m^3}. | 22899 | then 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 | ||
| 23185 | When working with trigonometric functions, it is best to switch to | 23179 | When working with trigonometric functions, it is best to switch to |
| 23186 | radians mode first (with @w{@kbd{m r}}). The derivative of @samp{sin(x)} | 23180 | Radians mode first (with @w{@kbd{m r}}). The derivative of @samp{sin(x)} |
| 23187 | in degrees is @samp{(pi/180) cos(x)}, probably not the expected | 23181 | in degrees is @samp{(pi/180) cos(x)}, probably not the expected |
| 23188 | answer! | 23182 | answer! |
| 23189 | 23183 | ||
| 23190 | If you use the @code{deriv} function directly in an algebraic formula, | 23184 | If you use the @code{deriv} function directly in an algebraic formula, |
| 23191 | you can write @samp{deriv(f,x,x0)} which represents the derivative | 23185 | you can write @samp{deriv(f,x,x0)} which represents the derivative |
| 23192 | of @expr{f} with respect to @expr{x}, evaluated at the point | 23186 | of @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 | ||
| 23196 | If the formula being differentiated contains functions which Calc does | 23190 | If the formula being differentiated contains functions which Calc does |
| @@ -23230,7 +23224,7 @@ all integrable functions, but it is able to integrate several large | |||
| 23230 | classes of formulas. In particular, any polynomial or rational function | 23224 | classes 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 |
| 23232 | don't have to be in explicit quotient form, however; | 23226 | don'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)} |
| 23235 | is not strictly a quotient of polynomials, but it is equivalent to | 23229 | is 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$. | |||
| 23256 | Please note that the current implementation of Calc's integrator sometimes | 23250 | Please note that the current implementation of Calc's integrator sometimes |
| 23257 | produces results that are significantly more complex than they need to | 23251 | produces results that are significantly more complex than they need to |
| 23258 | be. For example, the integral Calc finds for | 23252 | be. 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))} |
| 23261 | is several times more complicated than the answer Mathematica | 23255 | is several times more complicated than the answer Mathematica |
| 23262 | returns for the same input, although the two forms are numerically | 23256 | returns for the same input, although the two forms are numerically |
| @@ -23264,17 +23258,17 @@ equivalent. Also, any indefinite integral should be considered to have | |||
| 23264 | an arbitrary constant of integration added to it, although Calc does not | 23258 | an arbitrary constant of integration added to it, although Calc does not |
| 23265 | write an explicit constant of integration in its result. For example, | 23259 | write an explicit constant of integration in its result. For example, |
| 23266 | Calc's solution for | 23260 | Calc'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))} |
| 23269 | differs from the solution given in the @emph{CRC Math Tables} by a | 23263 | differs from the solution given in the @emph{CRC Math Tables} by a |
| 23270 | constant factor of | 23264 | constant 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}, |
| 23273 | due to a different choice of constant of integration. | 23267 | due to a different choice of constant of integration. |
| 23274 | 23268 | ||
| 23275 | The Calculator remembers all the integrals it has done. If conditions | 23269 | The Calculator remembers all the integrals it has done. If conditions |
| 23276 | change in a way that would invalidate the old integrals, say, a switch | 23270 | change in a way that would invalidate the old integrals, say, a switch |
| 23277 | from degrees to radians mode, then they will be thrown out. If you | 23271 | from Degrees to Radians mode, then they will be thrown out. If you |
| 23278 | suspect this is not happening when it should, use the | 23272 | suspect 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}. | |||
| 23328 | As a more serious example, the expression @samp{exp(x)/x} cannot be | 23322 | As a more serious example, the expression @samp{exp(x)/x} cannot be |
| 23329 | integrated in terms of the standard functions, so the ``exponential | 23323 | integrated in terms of the standard functions, so the ``exponential |
| 23330 | integral'' function | 23324 | integral'' function |
| 23331 | @texline @tmath{{\rm Ei}(x)} | 23325 | @texline @math{{\rm Ei}(x)} |
| 23332 | @infoline @expr{Ei(x)} | 23326 | @infoline @expr{Ei(x)} |
| 23333 | was invented to describe it. | 23327 | was invented to describe it. |
| 23334 | We can get Calc to do this integral in terms of a made-up @code{Ei} | 23328 | We can get Calc to do this integral in terms of a made-up @code{Ei} |
| @@ -23501,16 +23495,16 @@ form @expr{X = 0}. | |||
| 23501 | This command also works for inequalities, as in @expr{y < 3x + 6}. | 23495 | This command also works for inequalities, as in @expr{y < 3x + 6}. |
| 23502 | Some inequalities cannot be solved where the analogous equation could | 23496 | Some inequalities cannot be solved where the analogous equation could |
| 23503 | be; for example, solving | 23497 | be; 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} |
| 23506 | for @expr{b} is impossible | 23500 | for @expr{b} is impossible |
| 23507 | without knowing the sign of @expr{c}. In this case, @kbd{a S} will | 23501 | without knowing the sign of @expr{c}. In this case, @kbd{a S} will |
| 23508 | produce the result | 23502 | produce 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 |
| 23512 | inequality is now unknown. The inequality | 23506 | inequality 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} |
| 23515 | is not even partially solved. @xref{Declarations}, for a way to tell | 23509 | is not even partially solved. @xref{Declarations}, for a way to tell |
| 23516 | Calc that the signs of the variables in a formula are in fact known. | 23510 | Calc 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 | |||
| 23537 | general family of solutions. It will invent variables @code{n1}, | 23531 | general 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 |
| 23540 | signs (either @i{+1} or @i{-1}). If you don't use the Hyperbolic | 23534 | signs (either @mathit{+1} or @mathit{-1}). If you don't use the Hyperbolic |
| 23541 | flag, Calc will use zero in place of all arbitrary integers, and plus | 23535 | flag, Calc will use zero in place of all arbitrary integers, and plus |
| 23542 | one in place of all arbitrary signs. Note that variables like @code{n1} | 23536 | one in place of all arbitrary signs. Note that variables like @code{n1} |
| 23543 | and @code{s1} are not given any special interpretation in Calc except by | 23537 | and @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 | |||
| 23633 | for @expr{x} by taking cube roots. But in many cases, like | 23627 | for @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 |
| 23635 | into a form it can solve. The @kbd{a P} command can still deliver a | 23629 | into a form it can solve. The @kbd{a P} command can still deliver a |
| 23636 | list of numerical roots, however, provided that symbolic mode (@kbd{m s}) | 23630 | list of numerical roots, however, provided that Symbolic mode (@kbd{m s}) |
| 23637 | is not turned on. (If you work with symbolic mode on, recall that the | 23631 | is 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 |
| 23639 | formula on the stack with symbolic mode temporarily off.) Naturally, | 23633 | formula 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 |
| 23641 | are all numbers (real or complex). | 23635 | are all numbers (real or complex). |
| 23642 | 23636 | ||
| @@ -23970,11 +23964,11 @@ with the minimum value itself. | |||
| 23970 | 23964 | ||
| 23971 | Note that this command looks for a @emph{local} minimum. Many functions | 23965 | Note that this command looks for a @emph{local} minimum. Many functions |
| 23972 | have more than one minimum; some, like | 23966 | have 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)}, |
| 23975 | have infinitely many. In fact, there is no easy way to define the | 23969 | have 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)} |
| 23979 | but Calc can still locate any particular local minimum | 23973 | but Calc can still locate any particular local minimum |
| 23980 | for you. Calc basically goes downhill from the initial guess until it | 23974 | for you. Calc basically goes downhill from the initial guess until it |
| @@ -24097,7 +24091,7 @@ the @dfn{parameters} of the model. | |||
| 24097 | The @kbd{a F} command takes the data set to be fitted from the stack. | 24091 | The @kbd{a F} command takes the data set to be fitted from the stack. |
| 24098 | By default, it expects the data in the form of a matrix. For example, | 24092 | By default, it expects the data in the form of a matrix. For example, |
| 24099 | for a linear or polynomial fit, this would be a | 24093 | for 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 |
| 24102 | matrix where the first row is a list of @expr{x} values and the second | 24096 | matrix where the first row is a list of @expr{x} values and the second |
| 24103 | row has the corresponding @expr{y} values. For the multilinear fit | 24097 | row 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 | ||
| 24107 | If you happen to have an | 24101 | If you happen to have an |
| 24108 | @texline @tmath{N\times2} | 24102 | @texline @math{N\times2} |
| 24109 | @infoline Nx2 | 24103 | @infoline Nx2 |
| 24110 | matrix instead of a | 24104 | matrix instead of a |
| 24111 | @texline @tmath{2\times N} | 24105 | @texline @math{2\times N} |
| 24112 | @infoline 2xN | 24106 | @infoline 2xN |
| 24113 | matrix, just press @kbd{v t} first to transpose the matrix. | 24107 | matrix, 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, | |||
| 24206 | and increases as various @expr{a + b x_i} values fail to match the | 24200 | and increases as various @expr{a + b x_i} values fail to match the |
| 24207 | corresponding @expr{y_i} values. There are several reasons why the | 24201 | corresponding @expr{y_i} values. There are several reasons why the |
| 24208 | summand is squared, one of them being to ensure that | 24202 | summand 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}. |
| 24211 | Least-squares fitting simply chooses the values of @expr{a} and @expr{b} | 24205 | Least-squares fitting simply chooses the values of @expr{a} and @expr{b} |
| 24212 | for which the error | 24206 | for which the error |
| 24213 | @texline @tmath{\chi^2} | 24207 | @texline @math{\chi^2} |
| 24214 | @infoline @expr{chi^2} | 24208 | @infoline @expr{chi^2} |
| 24215 | is as small as possible. | 24209 | is as small as possible. |
| 24216 | 24210 | ||
| @@ -24251,9 +24245,9 @@ Note that since the constant and linear terms are enough to fit the | |||
| 24251 | data exactly, it's no surprise that Calc chose a tiny contribution | 24245 | data exactly, it's no surprise that Calc chose a tiny contribution |
| 24252 | for @expr{x^2}. (The fact that it's not exactly zero is due only | 24246 | for @expr{x^2}. (The fact that it's not exactly zero is due only |
| 24253 | to roundoff error. Since our data are exact integers, we could get | 24247 | to roundoff error. Since our data are exact integers, we could get |
| 24254 | an exact answer by typing @kbd{m f} first to get fraction mode. | 24248 | an exact answer by typing @kbd{m f} first to get Fraction mode. |
| 24255 | Then the @expr{x^2} term would vanish altogether. Usually, though, | 24249 | Then the @expr{x^2} term would vanish altogether. Usually, though, |
| 24256 | the data being fitted will be approximate floats so fraction mode | 24250 | the data being fitted will be approximate floats so Fraction mode |
| 24257 | won't help.) | 24251 | won't help.) |
| 24258 | 24252 | ||
| 24259 | Doing the @kbd{a F 2} fit on the data set with 14 instead of 13 | 24253 | Doing 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 | ||
| 24267 | An important result from the theory of polynomial fitting is that it | 24261 | An important result from the theory of polynomial fitting is that it |
| 24268 | is always possible to fit @var{n} data points exactly using a polynomial | 24262 | is always possible to fit @var{n} data points exactly using a polynomial |
| 24269 | of degree @i{@var{n}-1}, sometimes called an @dfn{interpolating polynomial}. | 24263 | of degree @mathit{@var{n}-1}, sometimes called an @dfn{interpolating polynomial}. |
| 24270 | Using the modified (14) data matrix, a model number of 4 gives | 24264 | Using the modified (14) data matrix, a model number of 4 gives |
| 24271 | a polynomial that exactly matches all five data points: | 24265 | a 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. |
| 24279 | It is a good idea to increase the working precision to several | 24273 | It is a good idea to increase the working precision to several |
| 24280 | digits beyond what you need when you do a fitting operation. | 24274 | digits beyond what you need when you do a fitting operation. |
| 24281 | Or, if your data are exact, use fraction mode to get exact | 24275 | Or, if your data are exact, use Fraction mode to get exact |
| 24282 | results. | 24276 | results. |
| 24283 | 24277 | ||
| 24284 | You can type @kbd{i} instead of a digit at the model prompt to fit | 24278 | You 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 | |||
| 24371 | or all be plain numbers. Error forms can go anywhere but generally | 24365 | or all be plain numbers. Error forms can go anywhere but generally |
| 24372 | go on the numbers in the last row of the data matrix. If the last | 24366 | go on the numbers in the last row of the data matrix. If the last |
| 24373 | row contains error forms | 24367 | row 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}', |
| 24376 | then the | 24370 | then the |
| 24377 | @texline @tmath{\chi^2} | 24371 | @texline @math{\chi^2} |
| 24378 | @infoline @expr{chi^2} | 24372 | @infoline @expr{chi^2} |
| 24379 | statistic is now, | 24373 | statistic is now, |
| 24380 | 24374 | ||
| @@ -24397,7 +24391,7 @@ the fitting operation. | |||
| 24397 | If there are error forms on other rows of the data matrix, all the | 24391 | If there are error forms on other rows of the data matrix, all the |
| 24398 | errors for a given data point are combined; the square root of the | 24392 | errors for a given data point are combined; the square root of the |
| 24399 | sum of the squares of the errors forms the | 24393 | sum 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} |
| 24402 | used for the data point. | 24396 | used for the data point. |
| 24403 | 24397 | ||
| @@ -24407,14 +24401,14 @@ probably use @kbd{H a F} so that the output also contains error | |||
| 24407 | estimates. | 24401 | estimates. |
| 24408 | 24402 | ||
| 24409 | If the input contains error forms but all the | 24403 | If 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} |
| 24412 | values are the same, it is easy to see that the resulting fitted model | 24406 | values are the same, it is easy to see that the resulting fitted model |
| 24413 | will be the same as if the input did not have error forms at all | 24407 | will 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} |
| 24416 | is simply scaled uniformly by | 24410 | is 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}, |
| 24419 | which doesn't affect where it has a minimum). But there @emph{will} be | 24413 | which doesn't affect where it has a minimum). But there @emph{will} be |
| 24420 | a difference in the estimated errors of the coefficients reported by | 24414 | a 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 |
| 24450 | The covariance matrix @expr{C} computed from the fit. This is | 24444 | The covariance matrix @expr{C} computed from the fit. This is |
| 24451 | an @var{m}x@var{m} symmetric matrix; the diagonal elements | 24445 | an @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} |
| 24454 | are the variances | 24448 | are 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} |
| 24457 | of the parameters. The other elements are covariances | 24451 | of 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} |
| 24460 | that describe the correlation between pairs of parameters. (A related | 24454 | that describe the correlation between pairs of parameters. (A related |
| 24461 | set of numbers, the @dfn{linear correlation coefficients} | 24455 | set 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}, |
| 24464 | are defined as | 24458 | are 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 |
| 24475 | The value of | 24469 | The value of |
| 24476 | @texline @tmath{\chi^2} | 24470 | @texline @math{\chi^2} |
| 24477 | @infoline @expr{chi^2} | 24471 | @infoline @expr{chi^2} |
| 24478 | for the fit, calculated by the formulas shown above. This gives a | 24472 | for the fit, calculated by the formulas shown above. This gives a |
| 24479 | measure of the quality of the fit; statisticians consider | 24473 | measure 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} |
| 24482 | to indicate a moderately good fit (where again @expr{N} is the number of | 24476 | to indicate a moderately good fit (where again @expr{N} is the number of |
| 24483 | data points and @expr{M} is the number of parameters). | 24477 | data points and @expr{M} is the number of parameters). |
| @@ -24486,13 +24480,13 @@ data points and @expr{M} is the number of parameters). | |||
| 24486 | A measure of goodness of fit expressed as a probability @expr{Q}. | 24480 | A measure of goodness of fit expressed as a probability @expr{Q}. |
| 24487 | This is computed from the @code{utpc} probability distribution | 24481 | This is computed from the @code{utpc} probability distribution |
| 24488 | function using | 24482 | function using |
| 24489 | @texline @tmath{\chi^2} | 24483 | @texline @math{\chi^2} |
| 24490 | @infoline @expr{chi^2} | 24484 | @infoline @expr{chi^2} |
| 24491 | with @expr{N - M} degrees of freedom. A | 24485 | with @expr{N - M} degrees of freedom. A |
| 24492 | value of 0.5 implies a good fit; some texts recommend that often | 24486 | value 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 |
| 24494 | particular, | 24488 | particular, |
| 24495 | @texline @tmath{\chi^2} | 24489 | @texline @math{\chi^2} |
| 24496 | @infoline @expr{chi^2} | 24490 | @infoline @expr{chi^2} |
| 24497 | statistics assume the errors in your inputs | 24491 | statistics assume the errors in your inputs |
| 24498 | follow a normal (Gaussian) distribution; if they don't, you may | 24492 | follow a normal (Gaussian) distribution; if they don't, you may |
| @@ -24501,7 +24495,7 @@ have to accept smaller values of @expr{Q}. | |||
| 24501 | The @expr{Q} value is computed only if the input included error | 24495 | The @expr{Q} value is computed only if the input included error |
| 24502 | estimates. Otherwise, Calc will report the symbol @code{nan} | 24496 | estimates. Otherwise, Calc will report the symbol @code{nan} |
| 24503 | for @expr{Q}. The reason is that in this case the | 24497 | for @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} |
| 24506 | value has effectively been used to estimate the original errors | 24500 | value has effectively been used to estimate the original errors |
| 24507 | in the input, and thus there is no redundant information left | 24501 | in 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 |
| 24523 | Linear or multilinear. @i{a + b x + c y + d z}. | 24517 | Linear or multilinear. @mathit{a + b x + c y + d z}. |
| 24524 | @item 2-9 | 24518 | @item 2-9 |
| 24525 | Polynomials. @i{a + b x + c x^2 + d x^3}. | 24519 | Polynomials. @mathit{a + b x + c x^2 + d x^3}. |
| 24526 | @item e | 24520 | @item e |
| 24527 | Exponential. @i{a} @t{exp}@i{(b x)} @t{exp}@i{(c y)}. | 24521 | Exponential. @mathit{a} @t{exp}@mathit{(b x)} @t{exp}@mathit{(c y)}. |
| 24528 | @item E | 24522 | @item E |
| 24529 | Base-10 exponential. @i{a} @t{10^}@i{(b x)} @t{10^}@i{(c y)}. | 24523 | Base-10 exponential. @mathit{a} @t{10^}@mathit{(b x)} @t{10^}@mathit{(c y)}. |
| 24530 | @item x | 24524 | @item x |
| 24531 | Exponential (alternate notation). @t{exp}@i{(a + b x + c y)}. | 24525 | Exponential (alternate notation). @t{exp}@mathit{(a + b x + c y)}. |
| 24532 | @item X | 24526 | @item X |
| 24533 | Base-10 exponential (alternate). @t{10^}@i{(a + b x + c y)}. | 24527 | Base-10 exponential (alternate). @t{10^}@mathit{(a + b x + c y)}. |
| 24534 | @item l | 24528 | @item l |
| 24535 | Logarithmic. @i{a + b} @t{ln}@i{(x) + c} @t{ln}@i{(y)}. | 24529 | Logarithmic. @mathit{a + b} @t{ln}@mathit{(x) + c} @t{ln}@mathit{(y)}. |
| 24536 | @item L | 24530 | @item L |
| 24537 | Base-10 logarithmic. @i{a + b} @t{log10}@i{(x) + c} @t{log10}@i{(y)}. | 24531 | Base-10 logarithmic. @mathit{a + b} @t{log10}@mathit{(x) + c} @t{log10}@mathit{(y)}. |
| 24538 | @item ^ | 24532 | @item ^ |
| 24539 | General exponential. @i{a b^x c^y}. | 24533 | General exponential. @mathit{a b^x c^y}. |
| 24540 | @item p | 24534 | @item p |
| 24541 | Power law. @i{a x^b y^c}. | 24535 | Power law. @mathit{a x^b y^c}. |
| 24542 | @item q | 24536 | @item q |
| 24543 | Quadratic. @i{a + b (x-c)^2 + d (x-e)^2}. | 24537 | Quadratic. @mathit{a + b (x-c)^2 + d (x-e)^2}. |
| 24544 | @item g | 24538 | @item g |
| 24545 | Gaussian. | 24539 | Gaussian. |
| 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 | ||
| 24550 | All of these models are used in the usual way; just press the appropriate | 24544 | All 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} | |||
| 24656 | and @code{arcsin} when doing fits. For example, when you enter | 24650 | and @code{arcsin} when doing fits. For example, when you enter |
| 24657 | the model @samp{y = sin(a t + b)} Calc actually uses the easier | 24651 | the model @samp{y = sin(a t + b)} Calc actually uses the easier |
| 24658 | form @samp{arcsin(y) = a t + b}. The @code{arcsin} function always | 24652 | form @samp{arcsin(y) = a t + b}. The @code{arcsin} function always |
| 24659 | returns results in the range from @i{-90} to 90 degrees (or the | 24653 | returns results in the range from @mathit{-90} to 90 degrees (or the |
| 24660 | equivalent range in radians). Suppose you had data that you | 24654 | equivalent range in radians). Suppose you had data that you |
| 24661 | believed to represent roughly three oscillations of a sine wave, | 24655 | believed to represent roughly three oscillations of a sine wave, |
| 24662 | so that the argument of the sine might go from zero to | 24656 | so 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} |
| 24665 | degrees. | 24659 | degrees. |
| 24666 | The above model would appear to be a good way to determine the | 24660 | The above model would appear to be a good way to determine the |
| 24667 | true frequency and phase of the sine wave, but in practice it | 24661 | true frequency and phase of the sine wave, but in practice it |
| 24668 | would fail utterly. The righthand side of the actual model | 24662 | would 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 |
| 24670 | the lefthand side will bounce back and forth between @i{-90} and 90. | 24664 | the lefthand side will bounce back and forth between @mathit{-90} and 90. |
| 24671 | No values of @expr{a} and @expr{b} can make the two sides match, | 24665 | No values of @expr{a} and @expr{b} can make the two sides match, |
| 24672 | even approximately. | 24666 | even approximately. |
| 24673 | 24667 | ||
| @@ -24722,16 +24716,16 @@ ln(y) = ln(a) + b ln(x) | |||
| 24722 | 24716 | ||
| 24723 | @noindent | 24717 | @noindent |
| 24724 | which matches the desired form with | 24718 | which 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)}. |
| 24732 | Calc thus computes the logarithms of your @expr{y} and @expr{x} values, | 24726 | Calc thus computes the logarithms of your @expr{y} and @expr{x} values, |
| 24733 | does a linear fit for @expr{A} and @expr{B}, then solves to get | 24727 | does 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)} |
| 24736 | and @expr{b = B}. | 24730 | and @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 |
| 24747 | which matches with @expr{Y = y}, @expr{A = a + b c^2}, @expr{F = 1}, | 24741 | which 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 |
| 24749 | have been put into @expr{G} instead of @expr{B}), @expr{C = b}, and | 24743 | have 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. | |||
| 24777 | A last desperate step would be to use the general-purpose | 24771 | A 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 |
| 24779 | functions solve the problem of minimizing an expression (the | 24773 | functions 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} |
| 24782 | sum) by adjusting certain parameters in the expression. The @kbd{a F} | 24776 | sum) by adjusting certain parameters in the expression. The @kbd{a F} |
| 24783 | command is able to use a vastly more efficient algorithm due to its | 24777 | command 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 | |||
| 24788 | fit is linearizable, and use @code{minimize} on a call to @code{fit} | 24782 | fit is linearizable, and use @code{minimize} on a call to @code{fit} |
| 24789 | which efficiently takes care of the rest of the parameters. The thing | 24783 | which efficiently takes care of the rest of the parameters. The thing |
| 24790 | to be minimized would be the value of | 24784 | to 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} |
| 24793 | returned as the fifth result of the @code{xfit} function: | 24787 | returned 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 | |||
| 24848 | form with this combined error. The @expr{Y(x,y,z)} part of the | 24842 | form with this combined error. The @expr{Y(x,y,z)} part of the |
| 24849 | linearized model is evaluated, and the result should be an error | 24843 | linearized model is evaluated, and the result should be an error |
| 24850 | form. The error part of that result is used for | 24844 | form. 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} |
| 24853 | for the data point. If for some reason @expr{Y(x,y,z)} does not return | 24847 | for the data point. If for some reason @expr{Y(x,y,z)} does not return |
| 24854 | an error form, the combined error from @expr{z} is used directly for | 24848 | an 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}. |
| 24857 | Finally, @expr{z} is also stripped of its error | 24851 | Finally, @expr{z} is also stripped of its error |
| 24858 | for use in computing @expr{F(x,y,z)}, @expr{G(x,y,z)} and so on; | 24852 | for 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)} | |||
| 24864 | depends only on the dependent variable @expr{z}, and in fact is | 24858 | depends only on the dependent variable @expr{z}, and in fact is |
| 24865 | often simply equal to @expr{z}. For common cases like polynomials | 24859 | often simply equal to @expr{z}. For common cases like polynomials |
| 24866 | and multilinear models, the combined error is simply used as the | 24860 | and 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} |
| 24869 | for the data point with no further ado.) | 24863 | for 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 | |||
| 25218 | positive step size), the result is generally zero. However, | 25212 | positive step size), the result is generally zero. However, |
| 25219 | Calc only guarantees a zero result when the upper limit is | 25213 | Calc only guarantees a zero result when the upper limit is |
| 25220 | exactly one step less than the lower limit, i.e., if the number | 25214 | exactly one step less than the lower limit, i.e., if the number |
| 25221 | of iterations is @i{-1}. Thus @samp{sum(f(k), k, n, n-1)} is zero | 25215 | of iterations is @mathit{-1}. Thus @samp{sum(f(k), k, n, n-1)} is zero |
| 25222 | but the sum from @samp{n} to @samp{n-2} may report a nonzero value | 25216 | but the sum from @samp{n} to @samp{n-2} may report a nonzero value |
| 25223 | if Calc used a closed form solution. | 25217 | if Calc used a closed form solution. |
| 25224 | 25218 | ||
| @@ -25244,7 +25238,7 @@ formula works out to the indeterminate form @expr{0 / 0}, which | |||
| 25244 | Calc will not assume is zero. Better would be to use | 25238 | Calc 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 |
| 25246 | an ``if-then-else'' test: This expression says, ``if | 25240 | an ``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}, |
| 25249 | then @expr{1/(k-k_0)}, else zero.'' Now the formula @expr{1/(k-k_0)} | 25243 | then @expr{1/(k-k_0)}, else zero.'' Now the formula @expr{1/(k-k_0)} |
| 25250 | will not even be evaluated by Calc when @expr{k = k_0}. | 25244 | will 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 | ||
| 25950 | Note that @samp{*} is not commutative when applied to matrices, but | 25944 | Note that @samp{*} is not commutative when applied to matrices, but |
| 25951 | rewrite rules pretend that it is. If you type @kbd{m v} to enable | 25945 | rewrite rules pretend that it is. If you type @kbd{m v} to enable |
| 25952 | matrix mode (@pxref{Matrix Mode}), rewrite rules will match @samp{*} | 25946 | Matrix mode (@pxref{Matrix Mode}), rewrite rules will match @samp{*} |
| 25953 | literally, ignoring its usual commutativity property. (In the | 25947 | literally, ignoring its usual commutativity property. (In the |
| 25954 | current implementation, the associativity also vanishes---it is as | 25948 | current implementation, the associativity also vanishes---it is as |
| 25955 | if the pattern had been enclosed in a @code{plain} marker; see below.) | 25949 | if the pattern had been enclosed in a @code{plain} marker; see below.) |
| 25956 | If you are applying rewrites to formulas with matrices, it's best to | 25950 | If you are applying rewrites to formulas with matrices, it's best to |
| 25957 | enable matrix mode first to prevent algebraically incorrect rewrites | 25951 | enable Matrix mode first to prevent algebraically incorrect rewrites |
| 25958 | from occurring. | 25952 | from occurring. |
| 25959 | 25953 | ||
| 25960 | The pattern @samp{-x} will actually match any expression. For example, | 25954 | The 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 | |||
| 26259 | all three rules. It is possible to modify the imported rules | 26253 | all three rules. It is possible to modify the imported rules |
| 26260 | slightly: @samp{import(x, v1, x1, v2, x2, @dots{})} imports | 26254 | slightly: @samp{import(x, v1, x1, v2, x2, @dots{})} imports |
| 26261 | the rule set @expr{x} with all occurrences of | 26255 | the 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}, |
| 26264 | as either a variable name or a function name, replaced with | 26258 | as 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} |
| 26267 | and so on. (If | 26261 | and so on. (If |
| 26268 | @texline @tmath{v_1} | 26262 | @texline @math{v_1} |
| 26269 | @infoline @expr{v1} | 26263 | @infoline @expr{v1} |
| 26270 | is used as a function name, then | 26264 | is used as a function name, then |
| 26271 | @texline @tmath{x_1} | 26265 | @texline @math{x_1} |
| 26272 | @infoline @expr{x1} | 26266 | @infoline @expr{x1} |
| 26273 | must be either a function name itself or a @w{@samp{< >}} nameless | 26267 | must be either a function name itself or a @w{@samp{< >}} nameless |
| 26274 | function; @pxref{Specifying Operators}.) For example, @samp{[g(0) := 0, | 26268 | function; @pxref{Specifying Operators}.) For example, @samp{[g(0) := 0, |
| @@ -26431,8 +26425,8 @@ You must use @code{apply} for meta-variables with function names | |||
| 26431 | on both sides of a rewrite rule: @samp{apply(f, [x]) := f(x+1)} | 26425 | on both sides of a rewrite rule: @samp{apply(f, [x]) := f(x+1)} |
| 26432 | is @emph{not} correct, because it rewrites @samp{spam(6)} into | 26426 | is @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])}. |
| 26434 | Also note that you will have to use no-simplify (@kbd{m O}) | 26428 | Also note that you will have to use No-Simplify mode (@kbd{m O}) |
| 26435 | mode when entering this rule so that the @code{apply} isn't | 26429 | when entering this rule so that the @code{apply} isn't |
| 26436 | evaluated immediately to get the new rule @samp{f(x) := f(x+1)}. | 26430 | evaluated immediately to get the new rule @samp{f(x) := f(x+1)}. |
| 26437 | Or, use @kbd{s e} to enter the rule without going through the stack, | 26431 | Or, use @kbd{s e} to enter the rule without going through the stack, |
| 26438 | or enter the rule as @samp{apply(f, [x]) := apply(f, [x+1]) @w{:: 1}}. | 26432 | or 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 | |||
| 27167 | to expand trig functions. But if instead you store them in the | 27161 | to expand trig functions. But if instead you store them in the |
| 27168 | variable @code{EvalRules}, they will automatically be applied to all | 27162 | variable @code{EvalRules}, they will automatically be applied to all |
| 27169 | sines and cosines of sums. Then, with @samp{2 x} and @samp{45} on | 27163 | sines and cosines of sums. Then, with @samp{2 x} and @samp{45} on |
| 27170 | the stack, typing @kbd{+ S} will (assuming degrees mode) result in | 27164 | the 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 | ||
| 27173 | As each level of a formula is evaluated, the rules from | 27167 | As 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 | |||
| 27243 | the multiplication, addition, and square root functions directly rather | 27237 | the multiplication, addition, and square root functions directly rather |
| 27244 | than applying the default simplifications to this formula. So an | 27238 | than 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} |
| 27246 | would not apply. (However, if you put Calc into symbolic mode so that | 27240 | would 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 |
| 27248 | root function, your rule will be able to apply. But if the complex | 27242 | root function, your rule will be able to apply. But if the complex |
| 27249 | number were @expr{(3,4)}, so that @samp{sqrt(25)} must be calculated, | 27243 | number were @expr{(3,4)}, so that @samp{sqrt(25)} must be calculated, |
| 27250 | then symbolic mode will not help because @samp{sqrt(25)} can be | 27244 | then Symbolic mode will not help because @samp{sqrt(25)} can be |
| 27251 | evaluated exactly to 5.) | 27245 | evaluated exactly to 5.) |
| 27252 | 27246 | ||
| 27253 | One subtle restriction that normally only manifests itself with | 27247 | One 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)}. | |||
| 27354 | This will simplify the formula whenever @expr{b} and/or @expr{c} can | 27348 | This will simplify the formula whenever @expr{b} and/or @expr{c} can |
| 27355 | be made simpler by squaring. For example, applying this rule to | 27349 | be 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 |
| 27357 | Symbolic Mode has been enabled to keep the square root from being | 27351 | Symbolic mode has been enabled to keep the square root from being |
| 27358 | evaluated to a floating-point approximation). This rule is also | 27352 | evaluated to a floating-point approximation). This rule is also |
| 27359 | useful when working with symbolic complex numbers, e.g., | 27353 | useful 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 | |||
| 27464 | display anomaly, however; @samp{mm} will work just fine as a | 27458 | display anomaly, however; @samp{mm} will work just fine as a |
| 27465 | representation of one millimeter. | 27459 | representation of one millimeter. |
| 27466 | 27460 | ||
| 27467 | You may find that Algebraic Mode (@pxref{Algebraic Entry}) makes working | 27461 | You may find that Algebraic mode (@pxref{Algebraic Entry}) makes working |
| 27468 | with units expressions easier. Otherwise, you will have to remember | 27462 | with units expressions easier. Otherwise, you will have to remember |
| 27469 | to hit the apostrophe key every time you wish to enter units. | 27463 | to 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 | |||
| 27734 | units. | 27728 | units. |
| 27735 | 27729 | ||
| 27736 | Two units, @code{pi} and @code{fsc} (the fine structure constant, | 27730 | Two units, @code{pi} and @code{fsc} (the fine structure constant, |
| 27737 | approximately @i{1/137}) are dimensionless. The units simplification | 27731 | approximately @mathit{1/137}) are dimensionless. The units simplification |
| 27738 | commands simply treat these names as equivalent to their corresponding | 27732 | commands simply treat these names as equivalent to their corresponding |
| 27739 | values. However you can, for example, use @kbd{u c} to convert a pure | 27733 | values. However you can, for example, use @kbd{u c} to convert a pure |
| 27740 | number into multiples of the fine structure constant, or @kbd{u b} to | 27734 | number 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 | |||
| 27951 | order of the operands. If @expr{v} represents the contents of the | 27945 | order of the operands. If @expr{v} represents the contents of the |
| 27952 | variable, and @expr{a} is the value drawn from the stack, then regular | 27946 | variable, 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}, |
| 27956 | but @kbd{I s -} assigns | 27950 | but @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}. |
| 27959 | While @kbd{I s *} might seem pointless, it is | 27953 | While @kbd{I s *} might seem pointless, it is |
| 27960 | useful if matrix multiplication is involved. Actually, all the | 27954 | useful if matrix multiplication is involved. Actually, all the |
| @@ -28353,11 +28347,11 @@ including the current simplification mode. Recall that the | |||
| 28353 | formula @samp{x + y + x} is not handled by Calc's default | 28347 | formula @samp{x + y + x} is not handled by Calc's default |
| 28354 | simplifications, but the @kbd{a s} command will reduce it to | 28348 | simplifications, but the @kbd{a s} command will reduce it to |
| 28355 | the simpler form @samp{y + 2 x}. You can also type @kbd{m A} | 28349 | the simpler form @samp{y + 2 x}. You can also type @kbd{m A} |
| 28356 | to enable an algebraic-simplification mode in which the | 28350 | to enable an Algebraic Simplification mode in which the |
| 28357 | equivalent of @kbd{a s} is used on all of Calc's results. | 28351 | equivalent of @kbd{a s} is used on all of Calc's results. |
| 28358 | If you enter @samp{x + y + x =>} normally, the result will | 28352 | If you enter @samp{x + y + x =>} normally, the result will |
| 28359 | be @samp{x + y + x => x + y + x}. If you change to | 28353 | be @samp{x + y + x => x + y + x}. If you change to |
| 28360 | algebraic-simplification mode, the result will be | 28354 | Algebraic 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} |
| 28362 | once will have no effect on @samp{x + y + x => x + y + x}, | 28356 | once will have no effect on @samp{x + y + x => x + y + x}, |
| 28363 | because the righthand side depends only on the lefthand side | 28357 | because 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 := |
| 28399 | Embedded Mode also uses @samp{=>} operators. In embedded mode, | 28393 | Embedded mode also uses @samp{=>} operators. In Embedded mode, |
| 28400 | the lefthand side of an @samp{=>} operator can refer to variables | 28394 | the lefthand side of an @samp{=>} operator can refer to variables |
| 28401 | assigned elsewhere in the file by @samp{:=} operators. The | 28395 | assigned elsewhere in the file by @samp{:=} operators. The |
| 28402 | assignment operator @samp{a := 17} does not actually do anything | 28396 | assignment operator @samp{a := 17} does not actually do anything |
| 28403 | by itself. But Embedded Mode recognizes it and marks it as a sort | 28397 | by itself. But Embedded mode recognizes it and marks it as a sort |
| 28404 | of file-local definition of the variable. You can enter @samp{:=} | 28398 | of file-local definition of the variable. You can enter @samp{:=} |
| 28405 | operators in algebraic mode, or by using the @kbd{s :} | 28399 | operators 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 |
| 28407 | and value from the stack and replaces them with an assignment. | 28401 | and 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 |
| 28542 | in ``x'', and the same number of columns as elements in ``y''. The | 28536 | in ``x'', and the same number of columns as elements in ``y''. The |
| 28543 | result is a surface plot where | 28537 | result 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} |
| 28546 | is the height of the point | 28540 | is the height of the point |
| 28547 | at coordinate @expr{(x_i, y_j)} on the surface. The 3D graph will | 28541 | at 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 | |||
| 28652 | they are to look nice on the same graph.) | 28646 | they are to look nice on the same graph.) |
| 28653 | 28647 | ||
| 28654 | For example, to plot | 28648 | For 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)} |
| 28657 | for integers @expr{n} | 28651 | for integers @expr{n} |
| 28658 | from 1 to 5, you could use @kbd{v x} to create a vector of integers | 28652 | from 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, | |||
| 28903 | the @kbd{g a} and @kbd{g f} commands will use those style numbers | 28897 | the @kbd{g a} and @kbd{g f} commands will use those style numbers |
| 28904 | instead of the defaults for new curves that are added to the graph. | 28898 | instead of the defaults for new curves that are added to the graph. |
| 28905 | An entry should be a positive integer for a specific style, or 0 to let | 28899 | An entry should be a positive integer for a specific style, or 0 to let |
| 28906 | the style be chosen automatically, or @i{-1} to turn off lines or points | 28900 | the style be chosen automatically, or @mathit{-1} to turn off lines or points |
| 28907 | altogether. If there are more curves than elements in the vector, the | 28901 | altogether. If there are more curves than elements in the vector, the |
| 28908 | last few curves will continue to have the default styles. Of course, | 28902 | last few curves will continue to have the default styles. Of course, |
| 28909 | you can later use @kbd{g s} and @kbd{g S} to change any of these styles. | 28903 | you 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{|} | |||
| 28942 | to a buffer called @samp{*Gnuplot Trail*}, which Calc then displays. | 28936 | to a buffer called @samp{*Gnuplot Trail*}, which Calc then displays. |
| 28943 | The graph is made the same size as the Emacs screen, which on most | 28937 | The graph is made the same size as the Emacs screen, which on most |
| 28944 | dumb terminals will be | 28938 | dumb terminals will be |
| 28945 | @texline @tmath{80\times24} | 28939 | @texline @math{80\times24} |
| 28946 | @infoline 80x24 | 28940 | @infoline 80x24 |
| 28947 | characters. The graph is displayed in | 28941 | characters. The graph is displayed in |
| 28948 | an Emacs ``recursive edit''; type @kbd{q} or @kbd{M-# M-#} to exit | 28942 | an 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. | |||
| 29103 | The commands in this chapter move information between the Calculator and | 29097 | The commands in this chapter move information between the Calculator and |
| 29104 | other Emacs editing buffers. | 29098 | other Emacs editing buffers. |
| 29105 | 29099 | ||
| 29106 | In many cases Embedded Mode is an easier and more natural way to | 29100 | In many cases Embedded mode is an easier and more natural way to |
| 29107 | work with Calc from a regular editing buffer. @xref{Embedded Mode}. | 29101 | work 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 |
| 29254 | constituent rows and columns. (If it is a | 29248 | constituent rows and columns. (If it is a |
| 29255 | @texline @tmath{1\times1} | 29249 | @texline @math{1\times1} |
| 29256 | @infoline 1x1 | 29250 | @infoline 1x1 |
| 29257 | matrix, just hit @kbd{v u} (@code{calc-unpack}) twice.) | 29251 | matrix, 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 | |||
| 29374 | in the Calc window. | 29368 | in 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 | |||
| 29383 | and displays a picture of a calculator-style keypad. If you are using | 29377 | and displays a picture of a calculator-style keypad. If you are using |
| 29384 | the X window system, you can click on any of the ``keys'' in the | 29378 | the X window system, you can click on any of the ``keys'' in the |
| 29385 | keypad using the left mouse button to operate the calculator. | 29379 | keypad using the left mouse button to operate the calculator. |
| 29386 | The original window remains the selected window; in keypad mode | 29380 | The original window remains the selected window; in Keypad mode |
| 29387 | you can type in your file while simultaneously performing | 29381 | you can type in your file while simultaneously performing |
| 29388 | calculations with the mouse. | 29382 | calculations 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 |
| 29400 | is easier than using Calc normally, go right ahead. | 29394 | is easier than using Calc normally, go right ahead. |
| 29401 | 29395 | ||
| 29402 | Calc commands are more or less the same in keypad mode. Certain | 29396 | Calc commands are more or less the same in Keypad mode. Certain |
| 29403 | keypad keys differ slightly from the corresponding normal Calc | 29397 | keypad keys differ slightly from the corresponding normal Calc |
| 29404 | keystrokes; all such deviations are described below. | 29398 | keystrokes; all such deviations are described below. |
| 29405 | 29399 | ||
| 29406 | Keypad Mode includes many more commands than will fit on the keypad | 29400 | Keypad mode includes many more commands than will fit on the keypad |
| 29407 | at once. Click the right mouse button [@code{calc-keypad-menu}] | 29401 | at once. Click the right mouse button [@code{calc-keypad-menu}] |
| 29408 | to switch to the next menu. The bottom five rows of the keypad | 29402 | to switch to the next menu. The bottom five rows of the keypad |
| 29409 | stay the same; the top three rows change to a new set of commands. | 29403 | stay 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 |
| 29454 | This is the menu that appears the first time you start Keypad Mode. | 29448 | This is the menu that appears the first time you start Keypad mode. |
| 29455 | It will show up in a vertical window on the right side of your screen. | 29449 | It will show up in a vertical window on the right side of your screen. |
| 29456 | Above this menu is the traditional Calc stack display. On a 24-line | 29450 | Above this menu is the traditional Calc stack display. On a 24-line |
| 29457 | screen you will be able to see the top three stack entries. | 29451 | screen 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 | |||
| 29468 | stack. | 29462 | stack. |
| 29469 | 29463 | ||
| 29470 | The @key{INV} and @key{HYP} keys modify other keys. As well as | 29464 | The @key{INV} and @key{HYP} keys modify other keys. As well as |
| 29471 | having the effects described elsewhere in this manual, Keypad Mode | 29465 | having the effects described elsewhere in this manual, Keypad mode |
| 29472 | defines several other ``inverse'' operations. These are described | 29466 | defines several other ``inverse'' operations. These are described |
| 29473 | below and in the following sections. | 29467 | below and in the following sections. |
| 29474 | 29468 | ||
| @@ -29488,7 +29482,7 @@ The @key{EXEC} key prompts you to enter any keystroke sequence | |||
| 29488 | that would normally work in Calc mode. This can include a | 29482 | that would normally work in Calc mode. This can include a |
| 29489 | numeric prefix if you wish. It is also possible simply to | 29483 | numeric prefix if you wish. It is also possible simply to |
| 29490 | switch into the Calc window and type commands in it; there is | 29484 | switch into the Calc window and type commands in it; there is |
| 29491 | nothing ``magic'' about this window when Keypad Mode is active. | 29485 | nothing ``magic'' about this window when Keypad mode is active. |
| 29492 | 29486 | ||
| 29493 | The other keys in this display perform their obvious calculator | 29487 | The other keys in this display perform their obvious calculator |
| 29494 | functions. @key{CLN2} rounds the top-of-stack by temporarily | 29488 | functions. @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. | |||
| 29767 | The @key{STO} and @key{RCL} keys are analogous to @kbd{s t} and | 29761 | The @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 |
| 29770 | variables are not available in Keypad Mode.) You can also use, | 29764 | variables are not available in Keypad mode.) You can also use, |
| 29771 | for example, @kbd{STO + 3} to add to register 3. | 29765 | for 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 |
| 29777 | Embedded Mode in Calc provides an alternative to copying numbers | 29771 | Embedded mode in Calc provides an alternative to copying numbers |
| 29778 | and formulas back and forth between editing buffers and the Calc | 29772 | and formulas back and forth between editing buffers and the Calc |
| 29779 | stack. In Embedded Mode, your editing buffer becomes temporarily | 29773 | stack. In Embedded mode, your editing buffer becomes temporarily |
| 29780 | linked to the stack and this copying is taken care of automatically. | 29774 | linked 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 | ||
| 29802 | Calc normally scans backward and forward in the buffer for the | 29796 | Calc normally scans backward and forward in the buffer for the |
| 29803 | nearest opening and closing @dfn{formula delimiters}. The simplest | 29797 | nearest opening and closing @dfn{formula delimiters}. The simplest |
| 29804 | delimiters are blank lines. Other delimiters that Embedded Mode | 29798 | delimiters are blank lines. Other delimiters that Embedded mode |
| 29805 | understands are: | 29799 | understands 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 |
| 30362 | Embedded Mode has a rather complicated mechanism for handling mode | 30356 | Embedded mode has a rather complicated mechanism for handling mode |
| 30363 | settings in Embedded formulas. It is possible to put annotations | 30357 | settings in Embedded formulas. It is possible to put annotations |
| 30364 | in the file that specify mode settings either global to the entire | 30358 | in the file that specify mode settings either global to the entire |
| 30365 | file or local to a particular formula or formulas. In the latter | 30359 | file or local to a particular formula or formulas. In the latter |
| 30366 | case, different modes can be specified for use when a formula | 30360 | case, different modes can be specified for use when a formula |
| 30367 | is the enabled Embedded Mode formula. | 30361 | is the enabled Embedded mode formula. |
| 30368 | 30362 | ||
| 30369 | When you give any mode-setting command, like @kbd{m f} (for fraction | 30363 | When you give any mode-setting command, like @kbd{m f} (for Fraction |
| 30370 | mode) or @kbd{d s} (for scientific notation), Embedded Mode adds | 30364 | mode) or @kbd{d s} (for scientific notation), Embedded mode adds |
| 30371 | a line like the following one to the file just before the opening | 30365 | a line like the following one to the file just before the opening |
| 30372 | delimiter of the formula. | 30366 | delimiter of the formula. |
| 30373 | 30367 | ||
| @@ -30420,7 +30414,7 @@ sure the value is of a legal type or range; if you write an | |||
| 30420 | annotation by hand, be sure to give a proper value or results | 30414 | annotation by hand, be sure to give a proper value or results |
| 30421 | will be unpredictable. Mode-setting annotations are case-sensitive. | 30415 | will be unpredictable. Mode-setting annotations are case-sensitive. |
| 30422 | 30416 | ||
| 30423 | While Embedded Mode is enabled, the word @code{Local} appears in | 30417 | While Embedded mode is enabled, the word @code{Local} appears in |
| 30424 | the mode line. This is to show that mode setting commands generate | 30418 | the mode line. This is to show that mode setting commands generate |
| 30425 | annotations that are ``local'' to the current formula or set of | 30419 | annotations that are ``local'' to the current formula or set of |
| 30426 | formulas. The @kbd{m R} (@code{calc-mode-record-mode}) command | 30420 | formulas. 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 | ||
| 30438 | The first kind of annotation will be used only while a formula | 30432 | The first kind of annotation will be used only while a formula |
| 30439 | is enabled in Embedded Mode. The second kind will be used only | 30433 | is enabled in Embedded mode. The second kind will be used only |
| 30440 | when the formula is @emph{not} enabled. (Whether the formula | 30434 | when the formula is @emph{not} enabled. (Whether the formula |
| 30441 | is ``active'' or not, i.e., whether Calc has seen this formula | 30435 | is ``active'' or not, i.e., whether Calc has seen this formula |
| 30442 | yet, is not relevant here.) | 30436 | yet, is not relevant here.) |
| @@ -30478,21 +30472,21 @@ We would have to go down to the other formula and press @kbd{M-# u} | |||
| 30478 | on it in order to get it to notice the new annotation. | 30472 | on it in order to get it to notice the new annotation. |
| 30479 | 30473 | ||
| 30480 | Two more mode-recording modes selectable by @kbd{m R} are @code{Save} | 30474 | Two 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 |
| 30482 | are recorded permanently in your Emacs startup file @file{~/.emacs} | 30476 | are recorded permanently in your Emacs startup file @file{~/.emacs} |
| 30483 | rather than by annotating the current document, and no-recording | 30477 | rather than by annotating the current document, and no-recording |
| 30484 | mode (where there is no symbol like @code{Save} or @code{Local} in | 30478 | mode (where there is no symbol like @code{Save} or @code{Local} in |
| 30485 | the mode line), in which mode-changing commands do not leave any | 30479 | the mode line), in which mode-changing commands do not leave any |
| 30486 | annotations at all. | 30480 | annotations at all. |
| 30487 | 30481 | ||
| 30488 | When Embedded Mode is not enabled, mode-recording modes except | 30482 | When Embedded mode is not enabled, mode-recording modes except |
| 30489 | for @code{Save} have no effect. | 30483 | for @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 |
| 30495 | You can modify Embedded Mode's behavior by setting various Lisp | 30489 | You can modify Embedded mode's behavior by setting various Lisp |
| 30496 | variables described here. Use @kbd{M-x set-variable} or | 30490 | variables 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 |
| 30498 | put a suitable @code{setq} statement in your @file{~/.emacs} | 30492 | put a suitable @code{setq} statement in your @file{~/.emacs} |
| @@ -30502,7 +30496,7 @@ file; @pxref{File Variables, , Local Variables in Files, emacs, the | |||
| 30502 | Emacs manual}.) | 30496 | Emacs manual}.) |
| 30503 | 30497 | ||
| 30504 | While none of these variables will be buffer-local by default, you | 30498 | While none of these variables will be buffer-local by default, you |
| 30505 | can make any of them local to any embedded-mode buffer. (Their | 30499 | can make any of them local to any Embedded mode buffer. (Their |
| 30506 | values in the @samp{*Calculator*} buffer are never used.) | 30500 | values 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 |
| 30592 | The @code{calc-embedded-close-plain} variable is a string which | 30586 | The @code{calc-embedded-close-plain} variable is a string which |
| 30593 | ends a ``plain'' formula. The default is @code{" %%%\n"}. Without | 30587 | ends a ``plain'' formula. The default is @code{" %%%\n"}. Without |
| 30594 | the trailing newline here, the first line of a ``big'' mode formula | 30588 | the trailing newline here, the first line of a Big mode formula |
| 30595 | that followed might be shifted over with respect to the other lines. | 30589 | that 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} | |||
| 31018 | is greater than @var{final} the body will not be executed at all. | 31012 | is greater than @var{final} the body will not be executed at all. |
| 31019 | Note that @var{step} may still be negative in this loop; the prefix | 31013 | Note that @var{step} may still be negative in this loop; the prefix |
| 31020 | argument merely constrains the loop-finished test. Likewise, a prefix | 31014 | argument merely constrains the loop-finished test. Likewise, a prefix |
| 31021 | argument of @i{-1} forces downward-counting conventions. | 31015 | argument 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 |
| 31053 | Keyboard macros sometimes want to operate under known conditions | 31047 | Keyboard macros sometimes want to operate under known conditions |
| 31054 | without affecting surrounding conditions. For example, a keyboard | 31048 | without affecting surrounding conditions. For example, a keyboard |
| 31055 | macro may wish to turn on Fraction Mode, or set a particular | 31049 | macro may wish to turn on Fraction mode, or set a particular |
| 31056 | precision, independent of the user's normal setting for those | 31050 | precision, independent of the user's normal setting for those |
| 31057 | modes. | 31051 | modes. |
| 31058 | 31052 | ||
| @@ -31101,7 +31095,7 @@ for all mode-setting commands inside the macro. | |||
| 31101 | In fact, @kbd{C-u Z `} is like @kbd{Z `} except that it sets the modes | 31095 | In fact, @kbd{C-u Z `} is like @kbd{Z `} except that it sets the modes |
| 31102 | listed above to their default values. As usual, the matching @kbd{Z '} | 31096 | listed above to their default values. As usual, the matching @kbd{Z '} |
| 31103 | will restore the modes to their settings from before the @kbd{C-u Z `}. | 31097 | will restore the modes to their settings from before the @kbd{C-u Z `}. |
| 31104 | Also, @w{@kbd{Z `}} with a negative prefix argument resets algebraic mode | 31098 | Also, @w{@kbd{Z `}} with a negative prefix argument resets the algebraic mode |
| 31105 | to its default (off) but leaves the other modes the same as they were | 31099 | to its default (off) but leaves the other modes the same as they were |
| 31106 | outside the construct. | 31100 | outside the construct. |
| 31107 | 31101 | ||
| @@ -31989,7 +31983,7 @@ same thing with a single division by 512. | |||
| 31989 | @tindex mysin | 31983 | @tindex mysin |
| 31990 | A somewhat limited sine function could be defined as follows, using the | 31984 | A somewhat limited sine function could be defined as follows, using the |
| 31991 | well-known Taylor series expansion for | 31985 | well-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 | |||
| 32173 | element is a formula string, then @code{calc-eval} sets all the | 32167 | element is a formula string, then @code{calc-eval} sets all the |
| 32174 | various Calc modes to their default values while the formula is | 32168 | various Calc modes to their default values while the formula is |
| 32175 | evaluated and formatted. For example, the precision is set to 12 | 32169 | evaluated and formatted. For example, the precision is set to 12 |
| 32176 | digits, digit grouping is turned off, and the normal language | 32170 | digits, digit grouping is turned off, and the Normal language |
| 32177 | mode is used. | 32171 | mode is used. |
| 32178 | 32172 | ||
| 32179 | This same principle applies to the other options discussed below. | 32173 | This 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 | |||
| 32196 | program actually considers the interaction with Calc's mode settings | 32190 | program actually considers the interaction with Calc's mode settings |
| 32197 | to be a feature. This will avoid all sorts of potential ``gotchas''; | 32191 | to be a feature. This will avoid all sorts of potential ``gotchas''; |
| 32198 | consider what happens with @samp{(calc-eval "sqrt(2)" 'num)} | 32192 | consider what happens with @samp{(calc-eval "sqrt(2)" 'num)} |
| 32199 | when the user has left Calc in symbolic mode or no-simplify mode. | 32193 | when the user has left Calc in Symbolic mode or No-Simplify mode. |
| 32200 | 32194 | ||
| 32201 | As another example, @samp{(equal (calc-eval '("$<$$") nil a b) "1")} | 32195 | As another example, @samp{(equal (calc-eval '("$<$$") nil a b) "1")} |
| 32202 | checks if the number in string @expr{a} is less than the one in | 32196 | checks if the number in string @expr{a} is less than the one in |
| @@ -32512,10 +32506,10 @@ which is not a Lisp list. | |||
| 32512 | Large integers are stored as lists of the form @samp{(bigpos @var{d0} | 32506 | Large 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 |
| 32516 | from 0 to 999. The least significant digit is @var{d0}; the last digit, | 32510 | from 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 |
| 32518 | example, the integer @i{-12345678} is stored as @samp{(bigneg 678 345 12)}. | 32512 | example, the integer @mathit{-12345678} is stored as @samp{(bigneg 678 345 12)}. |
| 32519 | 32513 | ||
| 32520 | The distinction between small and large integers is entirely hidden from | 32514 | The distinction between small and large integers is entirely hidden from |
| 32521 | the user. In @code{defmath} definitions, the Lisp predicate @code{integerp} | 32515 | the 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 |
| 32537 | precision), and @var{exp} (the ``exponent'') is a fixnum. The value of | 32531 | precision), and @var{exp} (the ``exponent'') is a fixnum. The value of |
| 32538 | the float is @samp{@var{mant} * 10^@var{exp}}. For example, the number | 32532 | the 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 |
| 32540 | are that the number 0.0 is always stored as @samp{(float 0 0)}, and, | 32534 | are that the number 0.0 is always stored as @samp{(float 0 0)}, and, |
| 32541 | except for the 0.0 case, the rightmost base-10 digit of @var{mant} is | 32535 | except for the 0.0 case, the rightmost base-10 digit of @var{mant} is |
| 32542 | always nonzero. (If the rightmost digit is zero, the number is | 32536 | always nonzero. (If the rightmost digit is zero, the number is |
| @@ -32772,7 +32766,7 @@ will be used. | |||
| 32772 | This function takes a Calc object and ``normalizes'' it. At the very | 32766 | This function takes a Calc object and ``normalizes'' it. At the very |
| 32773 | least this involves re-rounding floating-point values according to the | 32767 | least this involves re-rounding floating-point values according to the |
| 32774 | current precision and other similar jobs. Also, unless the user has | 32768 | current precision and other similar jobs. Also, unless the user has |
| 32775 | selected no-simplify mode (@pxref{Simplification Modes}), this involves | 32769 | selected No-Simplify mode (@pxref{Simplification Modes}), this involves |
| 32776 | actually evaluating a formula object by executing the function calls | 32770 | actually evaluating a formula object by executing the function calls |
| 32777 | it contains, and possibly also doing algebraic simplification, etc. | 32771 | it 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 | |||
| 32848 | specified, nothing happens. When the argument is two or more, | 32842 | specified, nothing happens. When the argument is two or more, |
| 32849 | the binary function @var{func} is reduced across the top @var{arg} | 32843 | the binary function @var{func} is reduced across the top @var{arg} |
| 32850 | stack elements; when the argument is negative, the function is | 32844 | stack elements; when the argument is negative, the function is |
| 32851 | mapped between the next-to-top @i{-@var{arg}} stack elements and the | 32845 | mapped between the next-to-top @mathit{-@var{arg}} stack elements and the |
| 32852 | top element. | 32846 | top 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 |
| 33137 | If Symbolic Mode is enabled, this will signal an error that causes | 33131 | If 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.) |
| 33140 | Note that if your function calls @samp{(sin 5)} in Symbolic Mode, the | 33134 | Note 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 |
| 33142 | function to be left unsimplified. You may instead wish to call | 33136 | function 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 |
| 33144 | return the formula @samp{sin(5)} to your function. | 33138 | return 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 |
| 33187 | the formula still in symbolic form. | 33181 | the formula still in symbolic form. |
| 33188 | 33182 | ||
| 33189 | If the current Simplification Mode is ``none'' or ``numeric arguments | 33183 | If the current simplification mode is ``none'' or ``numeric arguments |
| 33190 | only,'' @code{normalize} will act appropriately. However, the more | 33184 | only,'' @code{normalize} will act appropriately. However, the more |
| 33191 | powerful simplification modes (like algebraic simplification) are | 33185 | powerful simplification modes (like Algebraic Simplification) are |
| 33192 | not handled by @code{normalize}. They are handled by @code{calc-normalize}, | 33186 | not handled by @code{normalize}. They are handled by @code{calc-normalize}, |
| 33193 | which calls @code{normalize} and possibly some other routines, such | 33187 | which calls @code{normalize} and possibly some other routines, such |
| 33194 | as @code{simplify} or @code{simplify-units}. Programs generally will | 33188 | as @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 |
| 33270 | Compare the numbers @var{x} and @var{y}, and return @i{-1} if | 33264 | Compare 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})}, |
| 33272 | 0 if @samp{(math-equal @var{x} @var{y})}, or 2 if the order is | 33266 | 0 if @samp{(math-equal @var{x} @var{y})}, or 2 if the order is |
| 33273 | undefined or cannot be determined. | 33267 | undefined 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 |
| 33283 | Shift integer @var{x} left @var{n} decimal digits, or right @i{-@var{n}} | 33277 | Shift integer @var{x} left @var{n} decimal digits, or right @mathit{-@var{n}} |
| 33284 | digits with truncation toward zero. | 33278 | digits 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. | |||
| 33376 | If the current angular mode is Degrees or HMS, this function returns the | 33370 | If the current angular mode is Degrees or HMS, this function returns the |
| 33377 | integer 360. In Radians mode, this function returns either the | 33371 | integer 360. In Radians mode, this function returns either the |
| 33378 | corresponding value in radians to the current precision, or the formula | 33372 | corresponding 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 |
| 33380 | function @code{half-circle} and @code{quarter-circle}. | 33374 | function @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 |
| 33437 | Like @code{to-radians}, except that in Symbolic Mode a degrees to | 33431 | Like @code{to-radians}, except that in Symbolic mode a degrees to |
| 33438 | radians conversion yields a formula like @samp{@var{a}*pi/180}. | 33432 | radians 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 |
| 33442 | Like @code{from-radians}, except that in Symbolic Mode a radians to | 33436 | Like @code{from-radians}, except that in Symbolic mode a radians to |
| 33443 | degrees conversion yields a formula like @samp{@var{a}*180/pi}. | 33437 | degrees 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 |
| 33489 | If @var{n} is an integer or integer-valued float, this function | 33483 | If @var{n} is an integer or integer-valued float, this function |
| 33490 | returns zero. If @var{n} is a half-integer (i.e., an integer plus | 33484 | returns 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, |
| 33492 | it returns 1 or 3. If @var{n} is anything else, this function | 33486 | it returns 1 or 3. If @var{n} is anything else, this function |
| 33493 | returns @code{nil}. | 33487 | returns @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 |
| 35633 | With a prefix argument of 1, take a single | 35627 | With 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} |
| 35636 | matrix from the stack instead of two separate data vectors. | 35630 | matrix from the stack instead of two separate data vectors. |
| 35637 | 35631 | ||
| 35638 | @c 21 | 35632 | @c 21 |
| @@ -35834,7 +35828,7 @@ to evaluate variables. | |||
| 35834 | The variable is replaced by the formula shown on the right. The | 35828 | The variable is replaced by the formula shown on the right. The |
| 35835 | Inverse flag reverses the order of the operands, e.g., @kbd{I s - x} | 35829 | Inverse flag reverses the order of the operands, e.g., @kbd{I s - x} |
| 35836 | assigns | 35830 | assigns |
| 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 | |||
| 35842 | Press @kbd{?} repeatedly to see how to choose a model. Answer the | 35836 | Press @kbd{?} repeatedly to see how to choose a model. Answer the |
| 35843 | variables prompt with @expr{iv} or @expr{iv;pv} to specify | 35837 | variables prompt with @expr{iv} or @expr{iv;pv} to specify |
| 35844 | independent and parameter variables. A positive prefix argument | 35838 | independent and parameter variables. A positive prefix argument |
| 35845 | takes @i{@var{n}+1} vectors from the stack; a zero prefix takes a matrix | 35839 | takes @mathit{@var{n}+1} vectors from the stack; a zero prefix takes a matrix |
| 35846 | and a vector from the stack. | 35840 | and 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 |
| 1421 | style @code{gnu}, which sets it to blank. You can see the line | 1421 | style @code{gnu}, which sets it to blank. You can see the line |
| 1422 | splitting effect described here by setting a different style, | 1422 | splitting effect described here by setting a different style, |
| 1423 | e.g. @code{k&r} @xref{Choosing a Style}}, which makes a comment | 1423 | e.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 |
| 1647 | with the rest of @ccmode{}, so this section does not apply there. | 1647 | with 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 |
| 94 | describes a specified file or directory. | 94 | describes 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 |
| 1118 | The @kbd{w} command (@code{dired-copy-filename-as-kill}) puts the | 1118 | The @kbd{w} command (@code{dired-copy-filename-as-kill}) puts the |
| 1119 | names of the marked (or next @var{n}) files into the kill ring, as if | 1119 | names 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. | 194 | Commands 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 | ||
| 196 | when the mark is active. | ||
| 195 | 197 | ||
| 196 | @item | 198 | @item |
| 197 | Some commands operate on the region if a region is active. For | 199 | Some commands operate on the region if a region is active. For |
| @@ -320,6 +322,8 @@ next balanced expression (@pxref{Expressions}). These commands handle | |||
| 320 | arguments just like @kbd{M-f} and @kbd{C-M-f}. If you repeat these | 322 | arguments just like @kbd{M-f} and @kbd{C-M-f}. If you repeat these |
| 321 | commands, the region is extended. For example, you can type either | 323 | commands, 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. |
| 325 | The region is also extended when the mark is active in Transient Mark | ||
| 326 | mode, 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 |
| 384 | old mark on the mark ring. This is to make it easier for you to move | 388 | old mark on the mark ring. This is to make it easier for you to move |
| 385 | back later. Searches set the mark if they move point. You can tell | 389 | back later. Searches set the mark if they move point. However, in |
| 386 | when a command sets the mark because it displays @samp{Mark set} in the | 390 | Transient Mark mode, these commands do not set the mark when the mark |
| 387 | echo area. | 391 | is already active. You can tell when a command sets the mark because |
| 392 | it 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 |
| 390 | ring may not be convenient enough. If so, you can record the position | 395 | ring 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)} |
| 2249 | Find @var{filename}, guessing a default from text around point | 2249 | Find @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)} | ||
| 2259 | Start Dired on @var{directory}, defaulting to the directory name at | ||
| 2260 | point (@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 |
| 2258 | Search buffer for next file name or URL, then find that file or URL. | 2280 | Search 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)} | ||
| 2261 | Start Dired on @var{directory}, defaulting to the directory name at | ||
| 2262 | point (@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 | |||
| 27 | Permission is granted to copy, distribute and/or modify this document | 27 | Permission is granted to copy, distribute and/or modify this document |
| 28 | under the terms of the GNU Free Documentation License, Version 1.1 or | 28 | under the terms of the GNU Free Documentation License, Version 1.1 or |
| 29 | any later version published by the Free Software Foundation; with the | 29 | any later version published by the Free Software Foundation; with the |
| 30 | Invariant Sections being | 30 | Invariant Sections being |
| 31 | ``GNU GENERAL PUBLIC LICENSE''. A copy of the | 31 | ``GNU GENERAL PUBLIC LICENSE''. A copy of the |
| 32 | license is included in the section entitled ``GNU Free Documentation | 32 | license is included in the section entitled ``GNU Free Documentation |
| 33 | License.'' | 33 | License.'' |
| @@ -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 | |||
| 115 | the @var{path} component depends on the service. | 115 | the @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 |
| 205 | Retrieve @var{url} synchronously and return a buffer containing the | 205 | Retrieve @var{url} synchronously and return a buffer containing the |
| 206 | data. @var{url} is either a string or a parsed URL structure. Return | 206 | data. @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, |
| 208 | info, or mailto URLs that need no further processing). | 208 | info, 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 | |||
| 214 | has been completely retrieved, with the current buffer containing the | 214 | has been completely retrieved, with the current buffer containing the |
| 215 | object and any MIME headers associated with it. @var{url} is either a | 215 | object and any MIME headers associated with it. @var{url} is either a |
| 216 | string or a parsed URL structure. Returns the buffer @var{url} will | 216 | string or a parsed URL structure. Returns the buffer @var{url} will |
| 217 | load into, or @var{nil} if the process has already completed. | 217 | load 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 | |||
| 330 | can be weighted. In Emacs 21 this list is generated automatically | 330 | can be weighted. In Emacs 21 this list is generated automatically |
| 331 | from the list of defined coding systems which have associated MIME | 331 | from the list of defined coding systems which have associated MIME |
| 332 | types. These are sorted by coding priority. @xref{Recognize Coding, | 332 | types. 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 | ||
| 385 | HTTP URLs are retrieved into a buffer containing the HTTP headers | 385 | HTTP URLs are retrieved into a buffer containing the HTTP headers |
| 386 | followed by the body. Since the headers are quasi-MIME, they may be | 386 | followed by the body. Since the headers are quasi-MIME, they may be |
| 387 | processed using the MIME library. @inforef{Top, The MIME library, | 387 | processed using the MIME library. @xref{Top,, Emacs MIME, |
| 388 | emacs-mime}. The URL package provides a function to do this in | 388 | emacs-mime, The Emacs MIME Manual}. The URL package provides a |
| 389 | general: | 389 | function 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 |
| 392 | This function decodes charset-encoded text in the current buffer. In | 392 | This 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 | ||
| 416 | These schemes are defined in RFC 1808. | 416 | These 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 |
| 418 | allow reading arbitary files from hosts. Either @samp{ange-ftp} | 418 | allow 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 |
| 420 | hosts. Local files are accessed directly. | 420 | hosts. 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 |
| 452 | A mailto URL will send an email message to the address in the | 452 | A mailto URL will send an email message to the address in the |
| 453 | URL, for example @samp{mailto:foo@@bar.com} would compose a | 453 | URL, for example @samp{mailto:foo@@bar.com} would compose a |
| 454 | message to @samp{foo@@bar.com}. | 454 | message 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 |
| 458 | The function called whenever url needs to send mail. This should | 458 | The function called whenever url needs to send mail. This should |
| 459 | normally be left to default from @var{mail-user-agent}. @xref{Mail | 459 | normally be left to default from @var{mail-user-agent}. @xref{Mail |
| 460 | Methods, , Mail-Composition Methods, emacs, GNU Emacs Manual}. | 460 | Methods, , Mail-Composition Methods, emacs, The GNU Emacs Manual}. |
| 461 | @end defopt | 461 | @end defopt |
| 462 | 462 | ||
| 463 | An @samp{X-Url-From} header field containing the URL of the document | 463 | An @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 |
| 473 | otherwise a @var{header} header field is created with @var{contents} | 473 | otherwise a @var{header} header field is created with @var{contents} |
| 474 | as its contents. Note that the URL library does not consider any | 474 | as 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 | |||
| 493 | allowed for nntp an snews. | 493 | allowed for nntp an snews. |
| 494 | 494 | ||
| 495 | @table @samp | 495 | @table @samp |
| 496 | @item news:@var{newsgroup} | 496 | @item news:@var{newsgroup} |
| 497 | Retrieves a list of messages in @var{newsgroup}; | 497 | Retrieves a list of messages in @var{newsgroup}; |
| 498 | @item news:@var{message-id} | 498 | @item news:@var{message-id} |
| 499 | Retrieves the message with the given @var{message-id}; | 499 | Retrieves the message with the given @var{message-id}; |
| 500 | @item news:* | 500 | @item news:* |
| 501 | Retrieves a list of all available newsgroups; | 501 | Retrieves 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 |
| 511 | is :563. | 511 | is :563. |
| 512 | @cindex SSL | 512 | @cindex SSL |
| 513 | (It is tunnelled through SSL.) | 513 | (It is tunneled through SSL.) |
| 514 | 514 | ||
| 515 | An @samp{nntp} URL is the same as a news URL, except that the URL may | 515 | An @samp{nntp} URL is the same as a news URL, except that the URL may |
| 516 | specify an article by its number. | 516 | specify 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} |
| 555 | session to a function named in @code{url-irc-function}. | 555 | session to a function named in @code{url-irc-function}. |
| 556 | 556 | ||
| 557 | @defopt url-irc-function | 557 | @defopt url-irc-function |
| 558 | A function to actually open an IRC connection. | 558 | A 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 |
| 583 | omitted but the charset parameter supplied. If @samp{;base64} is | 583 | omitted but the charset parameter supplied. If @samp{;base64} is |
| 584 | present, the @var{data} are base64-encoded. | 584 | present, 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} |
| 818 | and @code{no_proxy} are also tried, in that order. | 818 | and @code{no_proxy} are also tried, in that order. |
| 819 | 819 | ||
| 820 | Proxies may also be specified directly in Lisp. | 820 | Proxies may also be specified directly in Lisp. |
| 821 | 821 | ||
| @@ -940,7 +940,7 @@ This specifies the default server, it takes the form | |||
| 940 | where @var{version} can be either 4 or 5. | 940 | where @var{version} can be either 4 or 5. |
| 941 | @end defopt | 941 | @end defopt |
| 942 | @defvar socks-password | 942 | @defvar socks-password |
| 943 | If this is @code{nil} then you will be asked for the passward, | 943 | If this is @code{nil} then you will be asked for the password, |
| 944 | otherwise it will be used as the password for authenticating you to | 944 | otherwise it will be used as the password for authenticating you to |
| 945 | the @sc{socks} server. | 945 | the @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, | |||
| 1052 | strings. The times are in the format returned by @code{current-time}. | 1052 | strings. 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 |
| 1055 | This function updates the hsitory table with an entry for @var{url} | 1055 | This function updates the history table with an entry for @var{url} |
| 1056 | accessed at the gievn @var{time}. | 1056 | accessed 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} | |||
| 1144 | only if an affirmative answer is given. | 1144 | only 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 |
| 1148 | A symbol specifying the type of gateway support to use fro connexions | 1148 | A symbol specifying the type of gateway support to use fro connexions |
| 1149 | from the local machine. The supported methods are: | 1149 | from the local machine. The supported methods are: |
| 1150 | 1150 | ||