aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Belanger2004-12-15 06:33:24 +0000
committerJay Belanger2004-12-15 06:33:24 +0000
commit07ce2eb3f84f2ffd798fa711efc5d3cf8c74a62d (patch)
treeaabd3d075548ae7f44e40ae43c1ed9576173ec6a
parentaa1f38cdfb6bb5094ed872a891e057258175374b (diff)
downloademacs-07ce2eb3f84f2ffd798fa711efc5d3cf8c74a62d.tar.gz
emacs-07ce2eb3f84f2ffd798fa711efc5d3cf8c74a62d.zip
Consistently capitalized all mode names.
(Answers to Exercises): Mention that an answer can be a fraction when in Fraction mode.
-rw-r--r--man/calc.texi440
1 files changed, 220 insertions, 220 deletions
diff --git a/man/calc.texi b/man/calc.texi
index 16447e4e953..8dfa75c6ded 100644
--- a/man/calc.texi
+++ b/man/calc.texi
@@ -463,7 +463,7 @@ Algebraic manipulation features, including symbolic calculus.
463Moving data to and from regular editing buffers. 463Moving data to and from regular editing buffers.
464 464
465@item 465@item
466``Embedded mode'' for manipulating Calc formulas and data directly 466Embedded mode for manipulating Calc formulas and data directly
467inside any editing buffer. 467inside any editing buffer.
468 468
469@item 469@item
@@ -766,7 +766,7 @@ To exit from Calc, press @kbd{q} or @kbd{M-# c} again.
766@noindent 766@noindent
767Calc has several user interfaces that are specialized for 767Calc has several user interfaces that are specialized for
768different kinds of tasks. As well as Calc's standard interface, 768different kinds of tasks. As well as Calc's standard interface,
769there are Quick Mode, Keypad Mode, and Embedded Mode. 769there are Quick mode, Keypad mode, and Embedded mode.
770 770
771@menu 771@menu
772* Starting Calc:: 772* Starting Calc::
@@ -801,7 +801,7 @@ doesn't matter for @kbd{M-#}) that says which Calc interface you
801want to use. 801want to use.
802 802
803To get Calc's standard interface, type @kbd{M-# c}. To get 803To get Calc's standard interface, type @kbd{M-# c}. To get
804Keypad Mode, type @kbd{M-# k}. Type @kbd{M-# ?} to get a brief 804Keypad mode, type @kbd{M-# k}. Type @kbd{M-# ?} to get a brief
805list of the available options, and type a second @kbd{?} to get 805list of the available options, and type a second @kbd{?} to get
806a complete list. 806a complete list.
807 807
@@ -814,7 +814,7 @@ function key twice is just like hitting @kbd{M-# M-#}.)
814 814
815If @kbd{M-#} doesn't work for you, you can always type explicit 815If @kbd{M-#} doesn't work for you, you can always type explicit
816commands like @kbd{M-x calc} (for the standard user interface) or 816commands like @kbd{M-x calc} (for the standard user interface) or
817@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}
818(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,
819type the full command (like @kbd{calc-keypad}) and press Return. 819type the full command (like @kbd{calc-keypad}) and press Return.
820 820
@@ -917,11 +917,11 @@ way to switch out of Calc momentarily to edit your file; type
917@subsection Quick Mode (Overview) 917@subsection Quick Mode (Overview)
918 918
919@noindent 919@noindent
920@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
921full complexity of the stack and trail. To use it, type @kbd{M-# q} 921full complexity of the stack and trail. To use it, type @kbd{M-# q}
922(@code{quick-calc}) in any regular editing buffer. 922(@code{quick-calc}) in any regular editing buffer.
923 923
924Quick Mode is very simple: It prompts you to type any formula in 924Quick mode is very simple: It prompts you to type any formula in
925standard algebraic notation (like @samp{4 - 2/3}) and then displays 925standard algebraic notation (like @samp{4 - 2/3}) and then displays
926the result at the bottom of the Emacs screen (@mathit{3.33333333333} 926the result at the bottom of the Emacs screen (@mathit{3.33333333333}
927in this case). You are then back in the same editing buffer you 927in this case). You are then back in the same editing buffer you
@@ -930,7 +930,7 @@ again to do another quick calculation. The result of the calculation
930will also be in the Emacs ``kill ring'' so that a @kbd{C-y} command 930will also be in the Emacs ``kill ring'' so that a @kbd{C-y} command
931at this point will yank the result into your editing buffer. 931at this point will yank the result into your editing buffer.
932 932
933Calc mode settings affect Quick Mode, too, though you will have to 933Calc mode settings affect Quick mode, too, though you will have to
934go into regular Calc (with @kbd{M-# c}) to change the mode settings. 934go into regular Calc (with @kbd{M-# c}) to change the mode settings.
935 935
936@c [fix-ref Quick Calculator mode] 936@c [fix-ref Quick Calculator mode]
@@ -940,12 +940,12 @@ go into regular Calc (with @kbd{M-# c}) to change the mode settings.
940@subsection Keypad Mode (Overview) 940@subsection Keypad Mode (Overview)
941 941
942@noindent 942@noindent
943@dfn{Keypad Mode} is a mouse-based interface to the Calculator. 943@dfn{Keypad mode} is a mouse-based interface to the Calculator.
944It is designed for use with terminals that support a mouse. If you 944It is designed for use with terminals that support a mouse. If you
945don't have a mouse, you will have to operate keypad mode with your 945don't have a mouse, you will have to operate Keypad mode with your
946arrow keys (which is probably more trouble than it's worth). 946arrow keys (which is probably more trouble than it's worth).
947 947
948Type @kbd{M-# k} to turn Keypad Mode on or off. Once again you 948Type @kbd{M-# k} to turn Keypad mode on or off. Once again you
949get two new windows, this time on the righthand side of the screen 949get two new windows, this time on the righthand side of the screen
950instead of at the bottom. The upper window is the familiar Calc 950instead of at the bottom. The upper window is the familiar Calc
951Stack; the lower window is a picture of a typical calculator keypad. 951Stack; the lower window is a picture of a typical calculator keypad.
@@ -981,12 +981,12 @@ Stack; the lower window is a picture of a typical calculator keypad.
981 |-----+-----+-----+-----+-----+ 981 |-----+-----+-----+-----+-----+
982@end smallexample 982@end smallexample
983 983
984Keypad Mode is much easier for beginners to learn, because there 984Keypad mode is much easier for beginners to learn, because there
985is no need to memorize lots of obscure key sequences. But not all 985is no need to memorize lots of obscure key sequences. But not all
986commands in regular Calc are available on the Keypad. You can 986commands in regular Calc are available on the Keypad. You can
987always switch the cursor into the Calc stack window to use 987always switch the cursor into the Calc stack window to use
988standard Calc commands if you need. Serious Calc users, though, 988standard Calc commands if you need. Serious Calc users, though,
989often find they prefer the standard interface over Keypad Mode. 989often find they prefer the standard interface over Keypad mode.
990 990
991To operate the Calculator, just click on the ``buttons'' of the 991To operate the Calculator, just click on the ``buttons'' of the
992keypad using your left mouse button. To enter the two numbers 992keypad using your left mouse button. To enter the two numbers
@@ -999,13 +999,13 @@ keypad change to show other sets of commands, such as advanced
999math functions, vector operations, and operations on binary 999math functions, vector operations, and operations on binary
1000numbers. 1000numbers.
1001 1001
1002Because Keypad Mode doesn't use the regular keyboard, Calc leaves 1002Because Keypad mode doesn't use the regular keyboard, Calc leaves
1003the cursor in your original editing buffer. You can type in 1003the cursor in your original editing buffer. You can type in
1004this buffer in the usual way while also clicking on the Calculator 1004this buffer in the usual way while also clicking on the Calculator
1005keypad. One advantage of Keypad Mode is that you don't need an 1005keypad. One advantage of Keypad mode is that you don't need an
1006explicit command to switch between editing and calculating. 1006explicit command to switch between editing and calculating.
1007 1007
1008If you press @kbd{M-# b} first, you get a full-screen Keypad Mode 1008If you press @kbd{M-# b} first, you get a full-screen Keypad mode
1009(@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
1010left, the stack in the lower right, and the trail on top. 1010left, the stack in the lower right, and the trail on top.
1011 1011
@@ -1043,7 +1043,7 @@ itself.
1043@subsection Embedded Mode (Overview) 1043@subsection Embedded Mode (Overview)
1044 1044
1045@noindent 1045@noindent
1046@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
1047editing buffer. Suppose you have a formula written as part of a 1047editing buffer. Suppose you have a formula written as part of a
1048document like this: 1048document like this:
1049 1049
@@ -1060,7 +1060,7 @@ is
1060@noindent 1060@noindent
1061and you wish to have Calc compute and format the derivative for 1061and you wish to have Calc compute and format the derivative for
1062you and store this derivative in the buffer automatically. To 1062you and store this derivative in the buffer automatically. To
1063do this with Embedded Mode, first copy the formula down to where 1063do this with Embedded mode, first copy the formula down to where
1064you want the result to be: 1064you want the result to be:
1065 1065
1066@smallexample 1066@smallexample
@@ -1099,7 +1099,7 @@ is
1099@end smallexample 1099@end smallexample
1100 1100
1101To make this look nicer, you might want to press @kbd{d =} to center 1101To make this look nicer, you might want to press @kbd{d =} to center
1102the formula, and even @kbd{d B} to use ``big'' display mode. 1102the formula, and even @kbd{d B} to use Big display mode.
1103 1103
1104@smallexample 1104@smallexample
1105@group 1105@group
@@ -1139,7 +1139,7 @@ righthand label: Type @kbd{d @} (1) @key{RET}}.
1139@end group 1139@end group
1140@end smallexample 1140@end smallexample
1141 1141
1142To leave Embedded Mode, type @kbd{M-# e} again. The mode line 1142To leave Embedded mode, type @kbd{M-# e} again. The mode line
1143and keyboard will revert to the way they were before. (If you have 1143and keyboard will revert to the way they were before. (If you have
1144actually been trying this as you read along, you'll want to press 1144actually been trying this as you read along, you'll want to press
1145@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.)
@@ -1154,7 +1154,7 @@ A slope of one-third corresponds to an angle of 1 degrees.
1154@end smallexample 1154@end smallexample
1155 1155
1156Place the cursor on the @samp{1}, then type @kbd{M-# w} to enable 1156Place the cursor on the @samp{1}, then type @kbd{M-# w} to enable
1157Embedded Mode on that number. Now type @kbd{3 /} (to get one-third), 1157Embedded mode on that number. Now type @kbd{3 /} (to get one-third),
1158and @kbd{I T} (the Inverse Tangent converts a slope into an angle), 1158and @kbd{I T} (the Inverse Tangent converts a slope into an angle),
1159then @w{@kbd{M-# w}} again to exit Embedded mode. 1159then @w{@kbd{M-# w}} again to exit Embedded mode.
1160 1160
@@ -1221,7 +1221,7 @@ move it out of that window.
1221Control whether @kbd{M-# c} and @kbd{M-# k} use the full screen. 1221Control whether @kbd{M-# c} and @kbd{M-# k} use the full screen.
1222 1222
1223@item Q 1223@item Q
1224Use Quick Mode for a single short calculation. 1224Use Quick mode for a single short calculation.
1225 1225
1226@item K 1226@item K
1227Turn Calc Keypad mode on or off. 1227Turn Calc Keypad mode on or off.
@@ -1270,7 +1270,7 @@ Yank a value from the Calculator into the current editing buffer.
1270@end iftex 1270@end iftex
1271 1271
1272@noindent 1272@noindent
1273Commands for use with Embedded Mode: 1273Commands for use with Embedded mode:
1274 1274
1275@table @kbd 1275@table @kbd
1276@item A 1276@item A
@@ -1478,9 +1478,9 @@ to skip on to the rest of this manual.
1478 1478
1479@c [fix-ref Embedded Mode] 1479@c [fix-ref Embedded Mode]
1480This tutorial describes the standard user interface of Calc only. 1480This tutorial describes the standard user interface of Calc only.
1481The ``Quick Mode'' and ``Keypad Mode'' interfaces are fairly 1481The Quick mode and Keypad mode interfaces are fairly
1482self-explanatory. @xref{Embedded Mode}, for a description of 1482self-explanatory. @xref{Embedded Mode}, for a description of
1483the ``Embedded Mode'' interface. 1483the Embedded mode interface.
1484 1484
1485@ifinfo 1485@ifinfo
1486The easiest way to read this tutorial on-line is to have two windows on 1486The easiest way to read this tutorial on-line is to have two windows on
@@ -1940,8 +1940,8 @@ entire stack.)
1940 1940
1941@noindent 1941@noindent
1942If you are not used to RPN notation, you may prefer to operate the 1942If you are not used to RPN notation, you may prefer to operate the
1943Calculator in ``algebraic mode,'' which is closer to the way 1943Calculator in Algebraic mode, which is closer to the way
1944non-RPN calculators work. In algebraic mode, you enter formulas 1944non-RPN calculators work. In Algebraic mode, you enter formulas
1945in traditional @expr{2+3} notation. 1945in traditional @expr{2+3} notation.
1946 1946
1947You don't really need any special ``mode'' to enter algebraic formulas. 1947You don't really need any special ``mode'' to enter algebraic formulas.
@@ -2005,15 +2005,15 @@ that @samp{^} is evaluated from right to left. Thus, @samp{2-3-4} is
2005equivalent to @samp{(2-3)-4} or @mathit{-5}, whereas @samp{2^3^4} is equivalent 2005equivalent to @samp{(2-3)-4} or @mathit{-5}, whereas @samp{2^3^4} is equivalent
2006to @samp{2^(3^4)} (a very large integer; try it!). 2006to @samp{2^(3^4)} (a very large integer; try it!).
2007 2007
2008If you tire of typing the apostrophe all the time, there is an 2008If you tire of typing the apostrophe all the time, there is
2009``algebraic mode'' you can select in which Calc automatically senses 2009Algebraic mode, where Calc automatically senses
2010when you are about to type an algebraic expression. To enter this 2010when you are about to type an algebraic expression. To enter this
2011mode, press the two letters @w{@kbd{m a}}. (An @samp{Alg} indicator 2011mode, press the two letters @w{@kbd{m a}}. (An @samp{Alg} indicator
2012should appear in the Calc window's mode line.) 2012should appear in the Calc window's mode line.)
2013 2013
2014Press @kbd{m a}, then @kbd{2+3+4} with no apostrophe, then @key{RET}. 2014Press @kbd{m a}, then @kbd{2+3+4} with no apostrophe, then @key{RET}.
2015 2015
2016In algebraic mode, when you press any key that would normally begin 2016In Algebraic mode, when you press any key that would normally begin
2017entering a number (such as a digit, a decimal point, or the @kbd{_} 2017entering a number (such as a digit, a decimal point, or the @kbd{_}
2018key), or if you press @kbd{(} or @kbd{[}, Calc automatically begins 2018key), or if you press @kbd{(} or @kbd{[}, Calc automatically begins
2019an algebraic entry. 2019an algebraic entry.
@@ -2028,7 +2028,7 @@ Press the apostrophe, then type @kbd{sqrt(5*2) - 3}. The result should
2028be @expr{0.16227766017}. 2028be @expr{0.16227766017}.
2029 2029
2030Note that if the formula begins with a function name, you need to use 2030Note that if the formula begins with a function name, you need to use
2031the apostrophe even if you are in algebraic mode. If you type @kbd{arcsin} 2031the apostrophe even if you are in Algebraic mode. If you type @kbd{arcsin}
2032out of the blue, the @kbd{a r} will be taken as an Algebraic Rewrite 2032out of the blue, the @kbd{a r} will be taken as an Algebraic Rewrite
2033command, and the @kbd{csin} will be taken as the name of the rewrite 2033command, and the @kbd{csin} will be taken as the name of the rewrite
2034rule to use! 2034rule to use!
@@ -2037,7 +2037,7 @@ Some people prefer to enter complex numbers and vectors in algebraic
2037form because they find RPN entry with incomplete objects to be too 2037form because they find RPN entry with incomplete objects to be too
2038distracting, even though they otherwise use Calc as an RPN calculator. 2038distracting, even though they otherwise use Calc as an RPN calculator.
2039 2039
2040Still in algebraic mode, type: 2040Still in Algebraic mode, type:
2041 2041
2042@smallexample 2042@smallexample
2043@group 2043@group
@@ -2053,15 +2053,15 @@ Algebraic mode allows us to enter complex numbers without pressing
2053an apostrophe first, but it also means we need to press @key{RET} 2053an apostrophe first, but it also means we need to press @key{RET}
2054after every entry, even for a simple number like @expr{1}. 2054after every entry, even for a simple number like @expr{1}.
2055 2055
2056(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
2057mode'' in which the @kbd{(} and @kbd{[} keys use algebraic entry even 2057mode in which the @kbd{(} and @kbd{[} keys use algebraic entry even
2058though regular numeric keys still use RPN numeric entry. There is also 2058though regular numeric keys still use RPN numeric entry. There is also
2059a ``total algebraic mode,'' started by typing @kbd{m t}, in which all 2059Total Algebraic mode, started by typing @kbd{m t}, in which all
2060normal keys begin algebraic entry. You must then use the @key{META} key 2060normal keys begin algebraic entry. You must then use the @key{META} key
2061to type Calc commands: @kbd{M-m t} to get back out of total algebraic 2061to type Calc commands: @kbd{M-m t} to get back out of Total Algebraic
2062mode, @kbd{M-q} to quit, etc.) 2062mode, @kbd{M-q} to quit, etc.)
2063 2063
2064If you're still in algebraic mode, press @kbd{m a} again to turn it off. 2064If you're still in Algebraic mode, press @kbd{m a} again to turn it off.
2065 2065
2066Actual non-RPN calculators use a mixture of algebraic and RPN styles. 2066Actual non-RPN calculators use a mixture of algebraic and RPN styles.
2067In general, operators of two numbers (like @kbd{+} and @kbd{*}) 2067In general, operators of two numbers (like @kbd{+} and @kbd{*})
@@ -2376,7 +2376,7 @@ during entry of a number or algebraic formula.
2376@noindent 2376@noindent
2377Calc has many types of @dfn{modes} that affect the way it interprets 2377Calc has many types of @dfn{modes} that affect the way it interprets
2378your commands or the way it displays data. We have already seen one 2378your commands or the way it displays data. We have already seen one
2379mode, namely algebraic mode. There are many others, too; we'll 2379mode, namely Algebraic mode. There are many others, too; we'll
2380try some of the most common ones here. 2380try some of the most common ones here.
2381 2381
2382Perhaps the most fundamental mode in Calc is the current @dfn{precision}. 2382Perhaps the most fundamental mode in Calc is the current @dfn{precision}.
@@ -2795,7 +2795,7 @@ and vice-versa.
2795@end group 2795@end group
2796@end smallexample 2796@end smallexample
2797 2797
2798Another interesting mode is @dfn{fraction mode}. Normally, 2798Another interesting mode is @dfn{Fraction mode}. Normally,
2799dividing two integers produces a floating-point result if the 2799dividing two integers produces a floating-point result if the
2800quotient can't be expressed as an exact integer. Fraction mode 2800quotient can't be expressed as an exact integer. Fraction mode
2801causes integer division to produce a fraction, i.e., a rational 2801causes integer division to produce a fraction, i.e., a rational
@@ -2819,7 +2819,7 @@ You can enter a fraction at any time using @kbd{:} notation.
2819(Calc uses @kbd{:} instead of @kbd{/} as the fraction separator 2819(Calc uses @kbd{:} instead of @kbd{/} as the fraction separator
2820because @kbd{/} is already used to divide the top two stack 2820because @kbd{/} is already used to divide the top two stack
2821elements.) Calculations involving fractions will always 2821elements.) Calculations involving fractions will always
2822produce exact fractional results; fraction mode only says 2822produce exact fractional results; Fraction mode only says
2823what to do when dividing two integers. 2823what to do when dividing two integers.
2824 2824
2825@cindex Fractions vs. floats 2825@cindex Fractions vs. floats
@@ -2830,7 +2830,7 @@ why would you ever use floating-point numbers instead?
2830 2830
2831Typing @kbd{m f} doesn't change any existing values in the stack. 2831Typing @kbd{m f} doesn't change any existing values in the stack.
2832In the above example, we had to Undo the division and do it over 2832In the above example, we had to Undo the division and do it over
2833again when we changed to fraction mode. But if you use the 2833again when we changed to Fraction mode. But if you use the
2834evaluates-to operator you can get commands like @kbd{m f} to 2834evaluates-to operator you can get commands like @kbd{m f} to
2835recompute for you. 2835recompute for you.
2836 2836
@@ -2846,7 +2846,7 @@ recompute for you.
2846@noindent 2846@noindent
2847In this example, the righthand side of the @samp{=>} operator 2847In this example, the righthand side of the @samp{=>} operator
2848on the stack is recomputed when we change the precision, then 2848on the stack is recomputed when we change the precision, then
2849again when we change to fraction mode. All @samp{=>} expressions 2849again when we change to Fraction mode. All @samp{=>} expressions
2850on the stack are recomputed every time you change any mode that 2850on the stack are recomputed every time you change any mode that
2851might affect their values. 2851might affect their values.
2852 2852
@@ -4530,7 +4530,7 @@ with the symbol @code{nan} (for Not A Number).
4530 4530
4531Dividing by zero is normally treated as an error, but you can get 4531Dividing by zero is normally treated as an error, but you can get
4532Calc to write an answer in terms of infinity by pressing @kbd{m i} 4532Calc to write an answer in terms of infinity by pressing @kbd{m i}
4533to turn on ``infinite mode.'' 4533to turn on Infinite mode.
4534 4534
4535@smallexample 4535@smallexample
4536@group 4536@group
@@ -4960,7 +4960,7 @@ formulas.
4960@subsection Basic Algebra 4960@subsection Basic Algebra
4961 4961
4962@noindent 4962@noindent
4963If you enter a formula in algebraic mode that refers to variables, 4963If you enter a formula in Algebraic mode that refers to variables,
4964the formula itself is pushed onto the stack. You can manipulate 4964the formula itself is pushed onto the stack. You can manipulate
4965formulas as regular data objects. 4965formulas as regular data objects.
4966 4966
@@ -5181,7 +5181,7 @@ polynomial? (The answer will be unique to within a constant
5181multiple; choose the solution where the leading coefficient is one.) 5181multiple; choose the solution where the leading coefficient is one.)
5182@xref{Algebra Answer 2, 2}. (@bullet{}) 5182@xref{Algebra Answer 2, 2}. (@bullet{})
5183 5183
5184The @kbd{m s} command enables ``symbolic mode,'' in which formulas 5184The @kbd{m s} command enables Symbolic mode, in which formulas
5185like @samp{sqrt(5)} that can't be evaluated exactly are left in 5185like @samp{sqrt(5)} that can't be evaluated exactly are left in
5186symbolic form rather than giving a floating-point approximate answer. 5186symbolic form rather than giving a floating-point approximate answer.
5187Fraction mode (@kbd{m f}) is also useful when doing algebra. 5187Fraction mode (@kbd{m f}) is also useful when doing algebra.
@@ -5196,7 +5196,7 @@ Fraction mode (@kbd{m f}) is also useful when doing algebra.
5196@end group 5196@end group
5197@end smallexample 5197@end smallexample
5198 5198
5199One more mode that makes reading formulas easier is ``Big mode.'' 5199One more mode that makes reading formulas easier is Big mode.
5200 5200
5201@smallexample 5201@smallexample
5202@group 5202@group
@@ -5344,7 +5344,7 @@ also have used plain @kbd{v x} as follows: @kbd{v x 10 @key{RET} 9 + .1 *}.)
5344 5344
5345@noindent 5345@noindent
5346(If you got wildly different results, did you remember to switch 5346(If you got wildly different results, did you remember to switch
5347to radians mode?) 5347to Radians mode?)
5348 5348
5349Here we have divided the curve into ten segments of equal width; 5349Here we have divided the curve into ten segments of equal width;
5350approximating these segments as rectangular boxes (i.e., assuming 5350approximating these segments as rectangular boxes (i.e., assuming
@@ -5600,7 +5600,7 @@ only once and stores the compiled form along with the variable. That's
5600another good reason to store your rules in variables rather than 5600another good reason to store your rules in variables rather than
5601entering them on the fly. 5601entering them on the fly.
5602 5602
5603(@bullet{}) @strong{Exercise 1.} Type @kbd{m s} to get symbolic 5603(@bullet{}) @strong{Exercise 1.} Type @kbd{m s} to get Symbolic
5604mode, then enter the formula @samp{@w{(2 + sqrt(2))} / @w{(1 + sqrt(2))}}. 5604mode, then enter the formula @samp{@w{(2 + sqrt(2))} / @w{(1 + sqrt(2))}}.
5605Using a rewrite rule, simplify this formula by multiplying both 5605Using a rewrite rule, simplify this formula by multiplying both
5606sides by the conjugate @w{@samp{1 - sqrt(2)}}. The result will have 5606sides by the conjugate @w{@samp{1 - sqrt(2)}}. The result will have
@@ -5859,11 +5859,11 @@ so that @expr{2 - 3 (x + y) + x y} is a sum of three terms.)
5859@xref{Rewrites Answer 5, 5}. (@bullet{}) 5859@xref{Rewrites Answer 5, 5}. (@bullet{})
5860 5860
5861(@bullet{}) @strong{Exercise 6.} Calc considers the form @expr{0^0} 5861(@bullet{}) @strong{Exercise 6.} Calc considers the form @expr{0^0}
5862to be ``indeterminate,'' and leaves it unevaluated (assuming infinite 5862to be ``indeterminate,'' and leaves it unevaluated (assuming Infinite
5863mode is not enabled). Some people prefer to define @expr{0^0 = 1}, 5863mode is not enabled). Some people prefer to define @expr{0^0 = 1},
5864so that the identity @expr{x^0 = 1} can safely be used for all @expr{x}. 5864so that the identity @expr{x^0 = 1} can safely be used for all @expr{x}.
5865Find a way to make Calc follow this convention. What happens if you 5865Find a way to make Calc follow this convention. What happens if you
5866now type @kbd{m i} to turn on infinite mode? 5866now type @kbd{m i} to turn on Infinite mode?
5867@xref{Rewrites Answer 6, 6}. (@bullet{}) 5867@xref{Rewrites Answer 6, 6}. (@bullet{})
5868 5868
5869(@bullet{}) @strong{Exercise 7.} A Taylor series for a function is an 5869(@bullet{}) @strong{Exercise 7.} A Taylor series for a function is an
@@ -6838,7 +6838,7 @@ the result will be zero because Calc uses the general rule that ``zero
6838times anything is zero.'' 6838times anything is zero.''
6839 6839
6840@c [fix-ref Infinities] 6840@c [fix-ref Infinities]
6841The @kbd{m i} command enables an @dfn{infinite mode} in which @expr{1 / 0} 6841The @kbd{m i} command enables an @dfn{Infinite mode} in which @expr{1 / 0}
6842results in a special symbol that represents ``infinity.'' If you 6842results in a special symbol that represents ``infinity.'' If you
6843multiply infinity by zero, Calc uses another special new symbol to 6843multiply infinity by zero, Calc uses another special new symbol to
6844show that the answer is ``indeterminate.'' @xref{Infinities}, for 6844show that the answer is ``indeterminate.'' @xref{Infinities}, for
@@ -7002,7 +7002,7 @@ The result, when converted to an integer, will be off by 106.
7002 7002
7003Here are two solutions: Raise the precision enough that the 7003Here are two solutions: Raise the precision enough that the
7004floating-point round-off error is strictly to the right of the 7004floating-point round-off error is strictly to the right of the
7005decimal point. Or, convert to fraction mode so that @expr{123456789 / 2} 7005decimal point. Or, convert to Fraction mode so that @expr{123456789 / 2}
7006produces the exact fraction @expr{123456789:2}, which can be rounded 7006produces the exact fraction @expr{123456789:2}, which can be rounded
7007down by the @kbd{F} command without ever switching to floating-point 7007down by the @kbd{F} command without ever switching to floating-point
7008format. 7008format.
@@ -7015,9 +7015,9 @@ format.
7015does a floating-point calculation instead and produces @expr{1.5}. 7015does a floating-point calculation instead and produces @expr{1.5}.
7016 7016
7017Calc will find an exact result for a logarithm if the result is an integer 7017Calc will find an exact result for a logarithm if the result is an integer
7018or the reciprocal of an integer. But there is no efficient way to search 7018or (when in Fraction mode) the reciprocal of an integer. But there is
7019the space of all possible rational numbers for an exact answer, so Calc 7019no efficient way to search the space of all possible rational numbers
7020doesn't try. 7020for an exact answer, so Calc doesn't try.
7021 7021
7022@node Vector Answer 1, Vector Answer 2, Arithmetic Answer 2, Answers to Exercises 7022@node Vector Answer 1, Vector Answer 2, Arithmetic Answer 2, Answers to Exercises
7023@subsection Vector Tutorial Exercise 1 7023@subsection Vector Tutorial Exercise 1
@@ -7089,7 +7089,7 @@ matrix as usual.
7089@end group 7089@end group
7090@end smallexample 7090@end smallexample
7091 7091
7092This can be made more readable using @kbd{d B} to enable ``big'' display 7092This can be made more readable using @kbd{d B} to enable Big display
7093mode: 7093mode:
7094 7094
7095@smallexample 7095@smallexample
@@ -7100,7 +7100,7 @@ mode:
7100@end group 7100@end group
7101@end smallexample 7101@end smallexample
7102 7102
7103Type @kbd{d N} to return to ``normal'' display mode afterwards. 7103Type @kbd{d N} to return to Normal display mode afterwards.
7104 7104
7105@node Matrix Answer 3, List Answer 1, Matrix Answer 2, Answers to Exercises 7105@node Matrix Answer 3, List Answer 1, Matrix Answer 2, Answers to Exercises
7106@subsection Matrix Tutorial Exercise 3 7106@subsection Matrix Tutorial Exercise 3
@@ -8247,7 +8247,7 @@ so it settles for the conservative answer @code{uinf}.
8247 8247
8248@samp{ln(0) = -inf}. Here we have an infinite answer to a finite 8248@samp{ln(0) = -inf}. Here we have an infinite answer to a finite
8249input. As in the @expr{1 / 0} case, Calc will only use infinities 8249input. As in the @expr{1 / 0} case, Calc will only use infinities
8250here if you have turned on ``infinite'' mode. Otherwise, it will 8250here if you have turned on Infinite mode. Otherwise, it will
8251treat @samp{ln(0)} as an error. 8251treat @samp{ln(0)} as an error.
8252 8252
8253@node Types Answer 3, Types Answer 4, Types Answer 2, Answers to Exercises 8253@node Types Answer 3, Types Answer 4, Types Answer 2, Answers to Exercises
@@ -8461,7 +8461,7 @@ Calc normally treats division by zero as an error, so that the formula
8461@w{@samp{1 / [0 .. 10]}}, also (potentially) divides by zero because zero 8461@w{@samp{1 / [0 .. 10]}}, also (potentially) divides by zero because zero
8462is now a member of the interval. So Calc leaves this one unevaluated, too. 8462is now a member of the interval. So Calc leaves this one unevaluated, too.
8463 8463
8464If you turn on ``infinite'' mode by pressing @kbd{m i}, you will 8464If you turn on Infinite mode by pressing @kbd{m i}, you will
8465instead get the answer @samp{[0.1 .. inf]}, which includes infinity 8465instead get the answer @samp{[0.1 .. inf]}, which includes infinity
8466as a possible value. 8466as a possible value.
8467 8467
@@ -9124,7 +9124,7 @@ But then:
9124@end group 9124@end group
9125@end smallexample 9125@end smallexample
9126 9126
9127Perhaps more surprisingly, this rule still works with infinite mode 9127Perhaps more surprisingly, this rule still works with Infinite mode
9128turned on. Calc tries @code{EvalRules} before any built-in rules for 9128turned on. Calc tries @code{EvalRules} before any built-in rules for
9129a function. This allows you to override the default behavior of any 9129a function. This allows you to override the default behavior of any
9130Calc feature: Even though Calc now wants to evaluate @expr{0^0} to 9130Calc feature: Even though Calc now wants to evaluate @expr{0^0} to
@@ -9889,10 +9889,10 @@ By default this creates a pair of small windows, @samp{*Calculator*}
9889and @samp{*Calc Trail*}. The former displays the contents of the 9889and @samp{*Calc Trail*}. The former displays the contents of the
9890Calculator stack and is manipulated exclusively through Calc commands. 9890Calculator stack and is manipulated exclusively through Calc commands.
9891It is possible (though not usually necessary) to create several Calc 9891It is possible (though not usually necessary) to create several Calc
9892Mode buffers each of which has an independent stack, undo list, and 9892mode buffers each of which has an independent stack, undo list, and
9893mode settings. There is exactly one Calc Trail buffer; it records a 9893mode settings. There is exactly one Calc Trail buffer; it records a
9894list of the results of all calculations that have been done. The 9894list of the results of all calculations that have been done. The
9895Calc Trail buffer uses a variant of Calc Mode, so Calculator commands 9895Calc Trail buffer uses a variant of Calc mode, so Calculator commands
9896still work when the trail buffer's window is selected. It is possible 9896still work when the trail buffer's window is selected. It is possible
9897to turn the trail window off, but the @samp{*Calc Trail*} buffer itself 9897to turn the trail window off, but the @samp{*Calc Trail*} buffer itself
9898still exists and is updated silently. @xref{Trail Commands}. 9898still exists and is updated silently. @xref{Trail Commands}.
@@ -9906,7 +9906,7 @@ still exists and is updated silently. @xref{Trail Commands}.
9906In most installations, the @kbd{M-# c} key sequence is a more 9906In most installations, the @kbd{M-# c} key sequence is a more
9907convenient way to start the Calculator. Also, @kbd{M-# M-#} and 9907convenient way to start the Calculator. Also, @kbd{M-# M-#} and
9908@kbd{M-# #} are synonyms for @kbd{M-# c} unless you last used Calc 9908@kbd{M-# #} are synonyms for @kbd{M-# c} unless you last used Calc
9909in its ``keypad'' mode. 9909in its Keypad mode.
9910 9910
9911@kindex x 9911@kindex x
9912@kindex M-x 9912@kindex M-x
@@ -9978,7 +9978,7 @@ the keys with the mouse to operate the calculator. @xref{Keypad Mode}.
9978@pindex calc-quit 9978@pindex calc-quit
9979@cindex Quitting the Calculator 9979@cindex Quitting the Calculator
9980@cindex Exiting the Calculator 9980@cindex Exiting the Calculator
9981The @kbd{q} key (@code{calc-quit}) exits Calc Mode and closes the 9981The @kbd{q} key (@code{calc-quit}) exits Calc mode and closes the
9982Calculator's window(s). It does not delete the Calculator buffers. 9982Calculator's window(s). It does not delete the Calculator buffers.
9983If you type @kbd{M-x calc} again, the Calculator will reappear with the 9983If you type @kbd{M-x calc} again, the Calculator will reappear with the
9984contents of the stack intact. Typing @kbd{M-# c} or @kbd{M-# M-#} 9984contents of the stack intact. Typing @kbd{M-# c} or @kbd{M-# M-#}
@@ -10278,7 +10278,7 @@ expressions in this way. You may want to use @key{DEL} every so often to
10278clear previous results off the stack. 10278clear previous results off the stack.
10279 10279
10280You can press the apostrophe key during normal numeric entry to switch 10280You can press the apostrophe key during normal numeric entry to switch
10281the half-entered number into algebraic entry mode. One reason to do this 10281the half-entered number into Algebraic entry mode. One reason to do this
10282would be to use the full Emacs cursor motion and editing keys, which are 10282would be to use the full Emacs cursor motion and editing keys, which are
10283available during algebraic entry but not during numeric entry. 10283available during algebraic entry but not during numeric entry.
10284 10284
@@ -10289,7 +10289,7 @@ you complete your half-finished entry in a separate buffer.
10289 10289
10290@kindex m a 10290@kindex m a
10291@pindex calc-algebraic-mode 10291@pindex calc-algebraic-mode
10292@cindex Algebraic mode 10292@cindex Algebraic Mode
10293If you prefer algebraic entry, you can use the command @kbd{m a} 10293If you prefer algebraic entry, you can use the command @kbd{m a}
10294(@code{calc-algebraic-mode}) to set Algebraic mode. In this mode, 10294(@code{calc-algebraic-mode}) to set Algebraic mode. In this mode,
10295digits and other keys that would normally start numeric entry instead 10295digits and other keys that would normally start numeric entry instead
@@ -10300,7 +10300,7 @@ but you will have to press @key{RET} to terminate every number:
10300@kbd{2 @key{RET} 3 @key{RET} * 4 @key{RET} +} would accomplish the same 10300@kbd{2 @key{RET} 3 @key{RET} * 4 @key{RET} +} would accomplish the same
10301thing as @kbd{2*3+4 @key{RET}}. 10301thing as @kbd{2*3+4 @key{RET}}.
10302 10302
10303@cindex Incomplete algebraic mode 10303@cindex Incomplete Algebraic Mode
10304If you give a numeric prefix argument like @kbd{C-u} to the @kbd{m a} 10304If you give a numeric prefix argument like @kbd{C-u} to the @kbd{m a}
10305command, it enables Incomplete Algebraic mode; this is like regular 10305command, it enables Incomplete Algebraic mode; this is like regular
10306Algebraic mode except that it applies to the @kbd{(} and @kbd{[} keys 10306Algebraic mode except that it applies to the @kbd{(} and @kbd{[} keys
@@ -10308,15 +10308,15 @@ only. Numeric keys still begin a numeric entry in this mode.
10308 10308
10309@kindex m t 10309@kindex m t
10310@pindex calc-total-algebraic-mode 10310@pindex calc-total-algebraic-mode
10311@cindex Total algebraic mode 10311@cindex Total Algebraic Mode
10312The @kbd{m t} (@code{calc-total-algebraic-mode}) gives you an even 10312The @kbd{m t} (@code{calc-total-algebraic-mode}) gives you an even
10313stronger algebraic-entry mode, in which @emph{all} regular letter and 10313stronger algebraic-entry mode, in which @emph{all} regular letter and
10314punctuation keys begin algebraic entry. Use this if you prefer typing 10314punctuation keys begin algebraic entry. Use this if you prefer typing
10315@w{@kbd{sqrt( )}} instead of @kbd{Q}, @w{@kbd{factor( )}} instead of 10315@w{@kbd{sqrt( )}} instead of @kbd{Q}, @w{@kbd{factor( )}} instead of
10316@kbd{a f}, and so on. To type regular Calc commands when you are in 10316@kbd{a f}, and so on. To type regular Calc commands when you are in
10317``total'' algebraic mode, hold down the @key{META} key. Thus @kbd{M-q} 10317Total Algebraic mode, hold down the @key{META} key. Thus @kbd{M-q}
10318is the command to quit Calc, @kbd{M-p} sets the precision, and 10318is the command to quit Calc, @kbd{M-p} sets the precision, and
10319@kbd{M-m t} (or @kbd{M-m M-t}, if you prefer) turns total algebraic 10319@kbd{M-m t} (or @kbd{M-m M-t}, if you prefer) turns Total Algebraic
10320mode back off again. Meta keys also terminate algebraic entry, so 10320mode back off again. Meta keys also terminate algebraic entry, so
10321that @kbd{2+3 M-S} is equivalent to @kbd{2+3 @key{RET} M-S}. The symbol 10321that @kbd{2+3 M-S} is equivalent to @kbd{2+3 @key{RET} M-S}. The symbol
10322@samp{Alg*} will appear in the mode line whenever you are in this mode. 10322@samp{Alg*} will appear in the mode line whenever you are in this mode.
@@ -10577,7 +10577,7 @@ that you must always press @kbd{w} yourself to see the messages).
10577 10577
10578@noindent 10578@noindent
10579@pindex another-calc 10579@pindex another-calc
10580It is possible to have any number of Calc Mode buffers at once. 10580It is possible to have any number of Calc mode buffers at once.
10581Usually this is done by executing @kbd{M-x another-calc}, which 10581Usually this is done by executing @kbd{M-x another-calc}, which
10582is similar to @kbd{M-# c} except that if a @samp{*Calculator*} 10582is similar to @kbd{M-# c} except that if a @samp{*Calculator*}
10583buffer already exists, a new, independent one with a name of the 10583buffer already exists, a new, independent one with a name of the
@@ -10792,7 +10792,7 @@ The Calculator stores integers to arbitrary precision. Addition,
10792subtraction, and multiplication of integers always yields an exact 10792subtraction, and multiplication of integers always yields an exact
10793integer result. (If the result of a division or exponentiation of 10793integer result. (If the result of a division or exponentiation of
10794integers is not an integer, it is expressed in fractional or 10794integers is not an integer, it is expressed in fractional or
10795floating-point form according to the current Fraction Mode. 10795floating-point form according to the current Fraction mode.
10796@xref{Fraction Mode}.) 10796@xref{Fraction Mode}.)
10797 10797
10798A decimal integer is represented as an optional sign followed by a 10798A decimal integer is represented as an optional sign followed by a
@@ -10818,7 +10818,7 @@ A @dfn{fraction} is a ratio of two integers. Fractions are traditionally
10818written ``2/3'' but Calc uses the notation @samp{2:3}. (The @kbd{/} key 10818written ``2/3'' but Calc uses the notation @samp{2:3}. (The @kbd{/} key
10819performs RPN division; the following two sequences push the number 10819performs RPN division; the following two sequences push the number
10820@samp{2:3} on the stack: @kbd{2 :@: 3 @key{RET}}, or @kbd{2 @key{RET} 3 /} 10820@samp{2:3} on the stack: @kbd{2 :@: 3 @key{RET}}, or @kbd{2 @key{RET} 3 /}
10821assuming Fraction Mode has been enabled.) 10821assuming Fraction mode has been enabled.)
10822When the Calculator produces a fractional result it always reduces it to 10822When the Calculator produces a fractional result it always reduces it to
10823simplest form, which may in fact be an integer. 10823simplest form, which may in fact be an integer.
10824 10824
@@ -10932,7 +10932,7 @@ Complex numbers are entered in stages using incomplete objects.
10932Operations on rectangular complex numbers yield rectangular complex 10932Operations on rectangular complex numbers yield rectangular complex
10933results, and similarly for polar complex numbers. Where the two types 10933results, and similarly for polar complex numbers. Where the two types
10934are mixed, or where new complex numbers arise (as for the square root of 10934are mixed, or where new complex numbers arise (as for the square root of
10935a negative real), the current @dfn{Polar Mode} is used to determine the 10935a negative real), the current @dfn{Polar mode} is used to determine the
10936type. @xref{Polar Mode}. 10936type. @xref{Polar Mode}.
10937 10937
10938A complex result in which the imaginary part is zero (or the phase angle 10938A complex result in which the imaginary part is zero (or the phase angle
@@ -11020,7 +11020,7 @@ infinity, it's just that @emph{which} number it stands for
11020cannot be determined.) In Calc's notation, @samp{0 * inf = nan} 11020cannot be determined.) In Calc's notation, @samp{0 * inf = nan}
11021and @samp{inf / inf = nan}. A few other common indeterminate 11021and @samp{inf / inf = nan}. A few other common indeterminate
11022expressions are @samp{inf - inf} and @samp{inf ^ 0}. Also, 11022expressions are @samp{inf - inf} and @samp{inf ^ 0}. Also,
11023@samp{0 / 0 = nan} if you have turned on ``infinite mode'' 11023@samp{0 / 0 = nan} if you have turned on Infinite mode
11024(as described above). 11024(as described above).
11025 11025
11026Infinities are especially useful as parts of @dfn{intervals}. 11026Infinities are especially useful as parts of @dfn{intervals}.
@@ -11586,10 +11586,10 @@ rather than @samp{1 ..@: 0.1e2}. Add spaces or zeros if you want to
11586get the other interpretation. If you omit the lower or upper limit, 11586get the other interpretation. If you omit the lower or upper limit,
11587a default of @samp{-inf} or @samp{inf} (respectively) is furnished. 11587a default of @samp{-inf} or @samp{inf} (respectively) is furnished.
11588 11588
11589``Infinite mode'' also affects operations on intervals 11589Infinite mode also affects operations on intervals
11590(@pxref{Infinities}). Calc will always introduce an open infinity, 11590(@pxref{Infinities}). Calc will always introduce an open infinity,
11591as in @samp{1 / (0 .. 2] = [0.5 .. inf)}. But closed infinities, 11591as in @samp{1 / (0 .. 2] = [0.5 .. inf)}. But closed infinities,
11592@w{@samp{1 / [0 .. 2] = [0.5 .. inf]}}, arise only in infinite mode; 11592@w{@samp{1 / [0 .. 2] = [0.5 .. inf]}}, arise only in Infinite mode;
11593otherwise they are left unevaluated. Note that the ``direction'' of 11593otherwise they are left unevaluated. Note that the ``direction'' of
11594a zero is not an issue in this case since the zero is always assumed 11594a zero is not an issue in this case since the zero is always assumed
11595to be continuous with the rest of the interval. For intervals that 11595to be continuous with the rest of the interval. For intervals that
@@ -11904,7 +11904,7 @@ Commands that interpret (``parse'') text as algebraic formulas include
11904algebraic entry (@kbd{'}), editing commands like @kbd{`} which parse 11904algebraic entry (@kbd{'}), editing commands like @kbd{`} which parse
11905the contents of the editing buffer when you finish, the @kbd{M-# g} 11905the contents of the editing buffer when you finish, the @kbd{M-# g}
11906and @w{@kbd{M-# r}} commands, the @kbd{C-y} command, the X window system 11906and @w{@kbd{M-# r}} commands, the @kbd{C-y} command, the X window system
11907``paste'' mouse operation, and Embedded Mode. All of these operations 11907``paste'' mouse operation, and Embedded mode. All of these operations
11908use the same rules for parsing formulas; in particular, language modes 11908use the same rules for parsing formulas; in particular, language modes
11909(@pxref{Language Modes}) affect them all in the same way. 11909(@pxref{Language Modes}) affect them all in the same way.
11910 11910
@@ -12313,7 +12313,7 @@ Otherwise, the new mode information is appended to the end of the file.
12313@pindex calc-mode-record-mode 12313@pindex calc-mode-record-mode
12314The @kbd{m R} (@code{calc-mode-record-mode}) command tells Calc to 12314The @kbd{m R} (@code{calc-mode-record-mode}) command tells Calc to
12315record the new mode settings (as if by pressing @kbd{m m}) every 12315record the new mode settings (as if by pressing @kbd{m m}) every
12316time a mode setting changes. If Embedded Mode is enabled, other 12316time a mode setting changes. If Embedded mode is enabled, other
12317options are available; @pxref{Mode Settings in Embedded Mode}. 12317options are available; @pxref{Mode Settings in Embedded Mode}.
12318 12318
12319@kindex m F 12319@kindex m F
@@ -12494,7 +12494,7 @@ Functions that compute angles produce a number in radians, a number in
12494degrees, or an HMS form depending on the current angular mode. If the 12494degrees, or an HMS form depending on the current angular mode. If the
12495result is a complex number and the current mode is HMS, the number is 12495result is a complex number and the current mode is HMS, the number is
12496instead expressed in degrees. (Complex-number calculations would 12496instead expressed in degrees. (Complex-number calculations would
12497normally be done in radians mode, though. Complex numbers are converted 12497normally be done in Radians mode, though. Complex numbers are converted
12498to degrees by calculating the complex result in radians and then 12498to degrees by calculating the complex result in radians and then
12499multiplying by 180 over @cpi{}.) 12499multiplying by 180 over @cpi{}.)
12500 12500
@@ -12507,7 +12507,7 @@ multiplying by 180 over @cpi{}.)
12507The @kbd{m r} (@code{calc-radians-mode}), @kbd{m d} (@code{calc-degrees-mode}), 12507The @kbd{m r} (@code{calc-radians-mode}), @kbd{m d} (@code{calc-degrees-mode}),
12508and @kbd{m h} (@code{calc-hms-mode}) commands control the angular mode. 12508and @kbd{m h} (@code{calc-hms-mode}) commands control the angular mode.
12509The current angular mode is displayed on the Emacs mode line. 12509The current angular mode is displayed on the Emacs mode line.
12510The default angular mode is degrees. 12510The default angular mode is Degrees.
12511 12511
12512@node Polar Mode, Fraction Mode, Angular Modes, Calculation Modes 12512@node Polar Mode, Fraction Mode, Angular Modes, Calculation Modes
12513@subsection Polar Mode 12513@subsection Polar Mode
@@ -12523,7 +12523,7 @@ number, or by entering @kbd{( 2 @key{SPC} 3 )}.
12523@kindex m p 12523@kindex m p
12524@pindex calc-polar-mode 12524@pindex calc-polar-mode
12525The @kbd{m p} (@code{calc-polar-mode}) command toggles complex-number 12525The @kbd{m p} (@code{calc-polar-mode}) command toggles complex-number
12526preference between rectangular and polar forms. In polar mode, all 12526preference between rectangular and polar forms. In Polar mode, all
12527of the above example situations would produce polar complex numbers. 12527of the above example situations would produce polar complex numbers.
12528 12528
12529@node Fraction Mode, Infinite Mode, Polar Mode, Calculation Modes 12529@node Fraction Mode, Infinite Mode, Polar Mode, Calculation Modes
@@ -12543,8 +12543,8 @@ even though @kbd{6 @key{RET} 4 /} produces @expr{1.5}.
12543To set the Calculator to produce fractional results for normal integer 12543To set the Calculator to produce fractional results for normal integer
12544divisions, use the @kbd{m f} (@code{calc-frac-mode}) command. 12544divisions, use the @kbd{m f} (@code{calc-frac-mode}) command.
12545For example, @expr{8/4} produces @expr{2} in either mode, 12545For example, @expr{8/4} produces @expr{2} in either mode,
12546but @expr{6/4} produces @expr{3:2} in Fraction Mode, @expr{1.5} in 12546but @expr{6/4} produces @expr{3:2} in Fraction mode, @expr{1.5} in
12547Float Mode. 12547Float mode.
12548 12548
12549At any time you can use @kbd{c f} (@code{calc-float}) to convert a 12549At any time you can use @kbd{c f} (@code{calc-float}) to convert a
12550fraction to a float, or @kbd{c F} (@code{calc-fraction}) to convert a 12550fraction to a float, or @kbd{c F} (@code{calc-fraction}) to convert a
@@ -12567,25 +12567,25 @@ on and off. When the mode is off, infinities do not arise except
12567in calculations that already had infinities as inputs. (One exception 12567in calculations that already had infinities as inputs. (One exception
12568is that infinite open intervals like @samp{[0 .. inf)} can be 12568is that infinite open intervals like @samp{[0 .. inf)} can be
12569generated; however, intervals closed at infinity (@samp{[0 .. inf]}) 12569generated; however, intervals closed at infinity (@samp{[0 .. inf]})
12570will not be generated when infinite mode is off.) 12570will not be generated when Infinite mode is off.)
12571 12571
12572With infinite mode turned on, @samp{1 / 0} will generate @code{uinf}, 12572With Infinite mode turned on, @samp{1 / 0} will generate @code{uinf},
12573an undirected infinity. @xref{Infinities}, for a discussion of the 12573an undirected infinity. @xref{Infinities}, for a discussion of the
12574difference between @code{inf} and @code{uinf}. Also, @expr{0 / 0} 12574difference between @code{inf} and @code{uinf}. Also, @expr{0 / 0}
12575evaluates to @code{nan}, the ``indeterminate'' symbol. Various other 12575evaluates to @code{nan}, the ``indeterminate'' symbol. Various other
12576functions can also return infinities in this mode; for example, 12576functions can also return infinities in this mode; for example,
12577@samp{ln(0) = -inf}, and @samp{gamma(-7) = uinf}. Once again, 12577@samp{ln(0) = -inf}, and @samp{gamma(-7) = uinf}. Once again,
12578note that @samp{exp(inf) = inf} regardless of infinite mode because 12578note that @samp{exp(inf) = inf} regardless of Infinite mode because
12579this calculation has infinity as an input. 12579this calculation has infinity as an input.
12580 12580
12581@cindex Positive infinite mode 12581@cindex Positive Infinite mode
12582The @kbd{m i} command with a numeric prefix argument of zero, 12582The @kbd{m i} command with a numeric prefix argument of zero,
12583i.e., @kbd{C-u 0 m i}, turns on a ``positive infinite mode'' in 12583i.e., @kbd{C-u 0 m i}, turns on a Positive Infinite mode in
12584which zero is treated as positive instead of being directionless. 12584which zero is treated as positive instead of being directionless.
12585Thus, @samp{1 / 0 = inf} and @samp{-1 / 0 = -inf} in this mode. 12585Thus, @samp{1 / 0 = inf} and @samp{-1 / 0 = -inf} in this mode.
12586Note that zero never actually has a sign in Calc; there are no 12586Note that zero never actually has a sign in Calc; there are no
12587separate representations for @mathit{+0} and @mathit{-0}. Positive 12587separate representations for @mathit{+0} and @mathit{-0}. Positive
12588infinite mode merely changes the interpretation given to the 12588Infinite mode merely changes the interpretation given to the
12589single symbol, @samp{0}. One consequence of this is that, while 12589single symbol, @samp{0}. One consequence of this is that, while
12590you might expect @samp{1 / -0 = -inf}, actually @samp{1 / -0} 12590you might expect @samp{1 / -0 = -inf}, actually @samp{1 / -0}
12591is equivalent to @samp{1 / 0}, which is equal to positive @code{inf}. 12591is equivalent to @samp{1 / 0}, which is equal to positive @code{inf}.
@@ -12604,7 +12604,7 @@ number or a symbolic expression if the argument is an expression:
12604 12604
12605@kindex m s 12605@kindex m s
12606@pindex calc-symbolic-mode 12606@pindex calc-symbolic-mode
12607In @dfn{symbolic mode}, controlled by the @kbd{m s} (@code{calc-symbolic-mode}) 12607In @dfn{Symbolic mode}, controlled by the @kbd{m s} (@code{calc-symbolic-mode})
12608command, functions which would produce inexact, irrational results are 12608command, functions which would produce inexact, irrational results are
12609left in symbolic form. Thus @kbd{16 Q} pushes 4, but @kbd{2 Q} pushes 12609left in symbolic form. Thus @kbd{16 Q} pushes 4, but @kbd{2 Q} pushes
12610@samp{sqrt(2)}. 12610@samp{sqrt(2)}.
@@ -12631,12 +12631,12 @@ variables.)
12631@cindex Scalar mode 12631@cindex Scalar mode
12632Calc sometimes makes assumptions during algebraic manipulation that 12632Calc sometimes makes assumptions during algebraic manipulation that
12633are awkward or incorrect when vectors and matrices are involved. 12633are awkward or incorrect when vectors and matrices are involved.
12634Calc has two modes, @dfn{matrix mode} and @dfn{scalar mode}, which 12634Calc has two modes, @dfn{Matrix mode} and @dfn{Scalar mode}, which
12635modify its behavior around vectors in useful ways. 12635modify its behavior around vectors in useful ways.
12636 12636
12637@kindex m v 12637@kindex m v
12638@pindex calc-matrix-mode 12638@pindex calc-matrix-mode
12639Press @kbd{m v} (@code{calc-matrix-mode}) once to enter matrix mode. 12639Press @kbd{m v} (@code{calc-matrix-mode}) once to enter Matrix mode.
12640In this mode, all objects are assumed to be matrices unless provably 12640In this mode, all objects are assumed to be matrices unless provably
12641otherwise. One major effect is that Calc will no longer consider 12641otherwise. One major effect is that Calc will no longer consider
12642multiplication to be commutative. (Recall that in matrix arithmetic, 12642multiplication to be commutative. (Recall that in matrix arithmetic,
@@ -12655,18 +12655,18 @@ a true identity matrix of the appropriate size. On the other hand,
12655if it is combined with a scalar (as in @samp{idn(1) + 2}), Calc 12655if it is combined with a scalar (as in @samp{idn(1) + 2}), Calc
12656will assume it really was a scalar after all and produce, e.g., 3. 12656will assume it really was a scalar after all and produce, e.g., 3.
12657 12657
12658Press @kbd{m v} a second time to get scalar mode. Here, objects are 12658Press @kbd{m v} a second time to get Scalar mode. Here, objects are
12659assumed @emph{not} to be vectors or matrices unless provably so. 12659assumed @emph{not} to be vectors or matrices unless provably so.
12660For example, normally adding a variable to a vector, as in 12660For example, normally adding a variable to a vector, as in
12661@samp{[x, y, z] + a}, will leave the sum in symbolic form because 12661@samp{[x, y, z] + a}, will leave the sum in symbolic form because
12662as far as Calc knows, @samp{a} could represent either a number or 12662as far as Calc knows, @samp{a} could represent either a number or
12663another 3-vector. In scalar mode, @samp{a} is assumed to be a 12663another 3-vector. In Scalar mode, @samp{a} is assumed to be a
12664non-vector, and the addition is evaluated to @samp{[x+a, y+a, z+a]}. 12664non-vector, and the addition is evaluated to @samp{[x+a, y+a, z+a]}.
12665 12665
12666Press @kbd{m v} a third time to return to the normal mode of operation. 12666Press @kbd{m v} a third time to return to the normal mode of operation.
12667 12667
12668If you press @kbd{m v} with a numeric prefix argument @var{n}, you 12668If you press @kbd{m v} with a numeric prefix argument @var{n}, you
12669get a special ``dimensioned matrix mode'' in which matrices of 12669get a special ``dimensioned'' Matrix mode in which matrices of
12670unknown size are assumed to be @var{n}x@var{n} square matrices. 12670unknown size are assumed to be @var{n}x@var{n} square matrices.
12671Then, the function call @samp{idn(1)} will expand into an actual 12671Then, the function call @samp{idn(1)} will expand into an actual
12672matrix rather than representing a ``generic'' matrix. 12672matrix rather than representing a ``generic'' matrix.
@@ -12687,11 +12687,11 @@ for @samp{[x, y, z] + [1, 2, 3]}, but that's because you have broken
12687your earlier promise to Calc that @samp{a} would be scalar. 12687your earlier promise to Calc that @samp{a} would be scalar.
12688 12688
12689Another way to mix scalars and matrices is to use selections 12689Another way to mix scalars and matrices is to use selections
12690(@pxref{Selecting Subformulas}). Use matrix mode when operating on 12690(@pxref{Selecting Subformulas}). Use Matrix mode when operating on
12691your formula normally; then, to apply scalar mode to a certain part 12691your formula normally; then, to apply Scalar mode to a certain part
12692of the formula without affecting the rest just select that part, 12692of the formula without affecting the rest just select that part,
12693change into scalar mode and press @kbd{=} to resimplify the part 12693change into Scalar mode and press @kbd{=} to resimplify the part
12694under this mode, then change back to matrix mode before deselecting. 12694under this mode, then change back to Matrix mode before deselecting.
12695 12695
12696@node Automatic Recomputation, Working Message, Matrix Mode, Calculation Modes 12696@node Automatic Recomputation, Working Message, Matrix Mode, Calculation Modes
12697@subsection Automatic Recomputation 12697@subsection Automatic Recomputation
@@ -12707,7 +12707,7 @@ are changed. @xref{Evaluates-To Operator}.
12707The @kbd{m C} (@code{calc-auto-recompute}) command turns this 12707The @kbd{m C} (@code{calc-auto-recompute}) command turns this
12708automatic recomputation on and off. If you turn it off, Calc will 12708automatic recomputation on and off. If you turn it off, Calc will
12709not update @samp{=>} operators on the stack (nor those in the 12709not update @samp{=>} operators on the stack (nor those in the
12710attached Embedded Mode buffer, if there is one). They will not 12710attached Embedded mode buffer, if there is one). They will not
12711be updated unless you explicitly do so by pressing @kbd{=} or until 12711be updated unless you explicitly do so by pressing @kbd{=} or until
12712you press @kbd{m C} to turn recomputation back on. (While automatic 12712you press @kbd{m C} to turn recomputation back on. (While automatic
12713recomputation is off, you can think of @kbd{m C m C} as a command 12713recomputation is off, you can think of @kbd{m C m C} as a command
@@ -12828,7 +12828,7 @@ A common technique is to set the simplification mode down to the lowest
12828amount of simplification you will allow to be applied automatically, then 12828amount of simplification you will allow to be applied automatically, then
12829use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to 12829use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to
12830perform higher types of simplifications on demand. @xref{Algebraic 12830perform higher types of simplifications on demand. @xref{Algebraic
12831Definitions}, for another sample use of no-simplification mode. 12831Definitions}, for another sample use of No-Simplification mode.
12832 12832
12833@node Declarations, Display Modes, Simplification Modes, Mode Settings 12833@node Declarations, Display Modes, Simplification Modes, Mode Settings
12834@section Declarations 12834@section Declarations
@@ -13075,8 +13075,8 @@ and @code{y} are known to be vectors or matrices. (Calc currently
13075never distinguishes between @code{vector} and @code{matrix} 13075never distinguishes between @code{vector} and @code{matrix}
13076declarations.) 13076declarations.)
13077 13077
13078@xref{Matrix Mode}, for a discussion of ``matrix mode'' and 13078@xref{Matrix Mode}, for a discussion of Matrix mode and
13079``scalar mode,'' which are similar to declaring @samp{[All, matrix]} 13079Scalar mode, which are similar to declaring @samp{[All, matrix]}
13080or @samp{[All, scalar]} but much more convenient. 13080or @samp{[All, scalar]} but much more convenient.
13081 13081
13082One more type symbol that is recognized is used with the @kbd{H a d} 13082One more type symbol that is recognized is used with the @kbd{H a d}
@@ -13228,8 +13228,8 @@ remains unevaluated.
13228@tindex dscalar 13228@tindex dscalar
13229The @code{dscalar} function returns 1 if its argument is provably 13229The @code{dscalar} function returns 1 if its argument is provably
13230scalar, or 0 if its argument is provably non-scalar. It is left 13230scalar, or 0 if its argument is provably non-scalar. It is left
13231unevaluated if this cannot be determined. (If matrix mode or scalar 13231unevaluated if this cannot be determined. (If Matrix mode or Scalar
13232mode are in effect, this function returns 1 or 0, respectively, 13232mode is in effect, this function returns 1 or 0, respectively,
13233if it has no other information.) When Calc interprets a condition 13233if it has no other information.) When Calc interprets a condition
13234(say, in a rewrite rule) it considers an unevaluated formula to be 13234(say, in a rewrite rule) it considers an unevaluated formula to be
13235``false.'' Thus, @samp{dscalar(a)} is ``true'' only if @code{a} is 13235``false.'' Thus, @samp{dscalar(a)} is ``true'' only if @code{a} is
@@ -13338,7 +13338,7 @@ entirety.)
13338@cindex Digit grouping 13338@cindex Digit grouping
13339Long numbers can be hard to read if they have too many digits. For 13339Long numbers can be hard to read if they have too many digits. For
13340example, the factorial of 30 is 33 digits long! Press @kbd{d g} 13340example, the factorial of 30 is 33 digits long! Press @kbd{d g}
13341(@code{calc-group-digits}) to enable @dfn{grouping} mode, in which digits 13341(@code{calc-group-digits}) to enable @dfn{Grouping} mode, in which digits
13342are displayed in clumps of 3 or 4 (depending on the current radix) 13342are displayed in clumps of 3 or 4 (depending on the current radix)
13343separated by commas. 13343separated by commas.
13344 13344
@@ -13884,7 +13884,7 @@ line at a time (or several lines with a prefix argument).
13884Values on the stack are normally left-justified in the window. You can 13884Values on the stack are normally left-justified in the window. You can
13885control this arrangement by typing @kbd{d <} (@code{calc-left-justify}), 13885control this arrangement by typing @kbd{d <} (@code{calc-left-justify}),
13886@kbd{d >} (@code{calc-right-justify}), or @kbd{d =} 13886@kbd{d >} (@code{calc-right-justify}), or @kbd{d =}
13887(@code{calc-center-justify}). For example, in right-justification mode, 13887(@code{calc-center-justify}). For example, in Right-Justification mode,
13888stack entries are displayed flush-right against the right edge of the 13888stack entries are displayed flush-right against the right edge of the
13889window. 13889window.
13890 13890
@@ -13905,20 +13905,20 @@ breaking lines are given below. Notice that the interaction between
13905origin and line width is slightly different in each justification 13905origin and line width is slightly different in each justification
13906mode. 13906mode.
13907 13907
13908In left-justified mode, the line is indented by a number of spaces 13908In Left-Justified mode, the line is indented by a number of spaces
13909given by the origin (default zero). If the result is longer than the 13909given by the origin (default zero). If the result is longer than the
13910maximum line width, if given, or too wide to fit in the Calc window 13910maximum line width, if given, or too wide to fit in the Calc window
13911otherwise, then it is broken into lines which will fit; each broken 13911otherwise, then it is broken into lines which will fit; each broken
13912line is indented to the origin. 13912line is indented to the origin.
13913 13913
13914In right-justified mode, lines are shifted right so that the rightmost 13914In Right-Justified mode, lines are shifted right so that the rightmost
13915character is just before the origin, or just before the current 13915character is just before the origin, or just before the current
13916window width if no origin was specified. If the line is too long 13916window width if no origin was specified. If the line is too long
13917for this, then it is broken; the current line width is used, if 13917for this, then it is broken; the current line width is used, if
13918specified, or else the origin is used as a width if that is 13918specified, or else the origin is used as a width if that is
13919specified, or else the line is broken to fit in the window. 13919specified, or else the line is broken to fit in the window.
13920 13920
13921In centering mode, the origin is the column number of the center of 13921In Centering mode, the origin is the column number of the center of
13922each stack entry. If a line width is specified, lines will not be 13922each stack entry. If a line width is specified, lines will not be
13923allowed to go past that width; Calc will either indent less or 13923allowed to go past that width; Calc will either indent less or
13924break the lines if necessary. If no origin is specified, half the 13924break the lines if necessary. If no origin is specified, half the
@@ -13953,13 +13953,13 @@ Give a blank string (with @kbd{d @{ @key{RET}}) to turn the label off.
13953The @kbd{d @}} (@code{calc-right-label}) command similarly adds a 13953The @kbd{d @}} (@code{calc-right-label}) command similarly adds a
13954label on the righthand side. It does not affect positioning of 13954label on the righthand side. It does not affect positioning of
13955the stack entries unless they are right-justified. Also, if both 13955the stack entries unless they are right-justified. Also, if both
13956a line width and an origin are given in right-justified mode, the 13956a line width and an origin are given in Right-Justified mode, the
13957stack entry is justified to the origin and the righthand label is 13957stack entry is justified to the origin and the righthand label is
13958justified to the line width. 13958justified to the line width.
13959 13959
13960One application of labels would be to add equation numbers to 13960One application of labels would be to add equation numbers to
13961formulas you are manipulating in Calc and then copying into a 13961formulas you are manipulating in Calc and then copying into a
13962document (possibly using Embedded Mode). The equations would 13962document (possibly using Embedded mode). The equations would
13963typically be centered, and the equation numbers would be on the 13963typically be centered, and the equation numbers would be on the
13964left or right as you prefer. 13964left or right as you prefer.
13965 13965
@@ -14061,7 +14061,7 @@ such as powers, quotients, and square roots:
14061@noindent 14061@noindent
14062in place of @samp{sqrt((a+1)/b + c^2)}. 14062in place of @samp{sqrt((a+1)/b + c^2)}.
14063 14063
14064Subscripts like @samp{a_i} are displayed as actual subscripts in ``big'' 14064Subscripts like @samp{a_i} are displayed as actual subscripts in Big
14065mode. Double subscripts, @samp{a_i_j} (@samp{subscr(subscr(a, i), j)}) 14065mode. Double subscripts, @samp{a_i_j} (@samp{subscr(subscr(a, i), j)})
14066are displayed as @samp{a} with subscripts separated by commas: 14066are displayed as @samp{a} with subscripts separated by commas:
14067@samp{i, j}. They must still be entered in the usual underscore 14067@samp{i, j}. They must still be entered in the usual underscore
@@ -14134,12 +14134,12 @@ In C mode, vectors and matrices use curly braces instead of brackets.
14134Octal and hexadecimal values are written with leading @samp{0} or @samp{0x} 14134Octal and hexadecimal values are written with leading @samp{0} or @samp{0x}
14135rather than using the @samp{#} symbol. Array subscripting is 14135rather than using the @samp{#} symbol. Array subscripting is
14136translated into @code{subscr} calls, so that @samp{a[i]} in C 14136translated into @code{subscr} calls, so that @samp{a[i]} in C
14137mode is the same as @samp{a_i} in normal mode. Assignments 14137mode is the same as @samp{a_i} in Normal mode. Assignments
14138turn into the @code{assign} function, which Calc normally displays 14138turn into the @code{assign} function, which Calc normally displays
14139using the @samp{:=} symbol. 14139using the @samp{:=} symbol.
14140 14140
14141The variables @code{var-pi} and @code{var-e} would be displayed @samp{pi} 14141The variables @code{var-pi} and @code{var-e} would be displayed @samp{pi}
14142and @samp{e} in normal mode, but in C mode they are displayed as 14142and @samp{e} in Normal mode, but in C mode they are displayed as
14143@samp{M_PI} and @samp{M_E}, corresponding to the names of constants 14143@samp{M_PI} and @samp{M_E}, corresponding to the names of constants
14144typically provided in the @file{<math.h>} header. Functions whose 14144typically provided in the @file{<math.h>} header. Functions whose
14145names are different in C are translated automatically for entry and 14145names are different in C are translated automatically for entry and
@@ -14181,7 +14181,7 @@ function!).
14181 14181
14182Underscores are allowed in variable and function names in all of these 14182Underscores are allowed in variable and function names in all of these
14183language modes. The underscore here is equivalent to the @samp{#} in 14183language modes. The underscore here is equivalent to the @samp{#} in
14184normal mode, or to hyphens in the underlying Emacs Lisp variable names. 14184Normal mode, or to hyphens in the underlying Emacs Lisp variable names.
14185 14185
14186FORTRAN and Pascal modes normally do not adjust the case of letters in 14186FORTRAN and Pascal modes normally do not adjust the case of letters in
14187formulas. Most built-in Calc names use lower-case letters. If you use a 14187formulas. Most built-in Calc names use lower-case letters. If you use a
@@ -14823,7 +14823,7 @@ object.
14823@tindex choriz 14823@tindex choriz
14824The @code{choriz} function takes a vector of objects and composes 14824The @code{choriz} function takes a vector of objects and composes
14825them horizontally. For example, @samp{choriz([17, a b/c, d])} formats 14825them horizontally. For example, @samp{choriz([17, a b/c, d])} formats
14826as @w{@samp{17a b / cd}} in normal language mode, or as 14826as @w{@samp{17a b / cd}} in Normal language mode, or as
14827 14827
14828@example 14828@example
14829@group 14829@group
@@ -15086,7 +15086,7 @@ then return a certain measurement of the composition as an integer.
15086@tindex cwidth 15086@tindex cwidth
15087The @code{cwidth} function measures the width, in characters, of a 15087The @code{cwidth} function measures the width, in characters, of a
15088composition. For example, @samp{cwidth(a + b)} is 5, and 15088composition. For example, @samp{cwidth(a + b)} is 5, and
15089@samp{cwidth(a / b)} is 5 in normal mode, 1 in Big mode, and 11 in 15089@samp{cwidth(a / b)} is 5 in Normal mode, 1 in Big mode, and 11 in
15090@TeX{} mode (for @samp{@{a \over b@}}). The argument may involve 15090@TeX{} mode (for @samp{@{a \over b@}}). The argument may involve
15091the composition functions described in this section. 15091the composition functions described in this section.
15092 15092
@@ -15262,7 +15262,7 @@ unrelated to the syntax tables described in the Emacs manual.)
15262@pindex calc-edit-user-syntax 15262@pindex calc-edit-user-syntax
15263The @kbd{Z S} (@code{calc-edit-user-syntax}) command edits the 15263The @kbd{Z S} (@code{calc-edit-user-syntax}) command edits the
15264syntax table for the current language mode. If you want your 15264syntax table for the current language mode. If you want your
15265syntax to work in any language, define it in the normal language 15265syntax to work in any language, define it in the Normal language
15266mode. Type @kbd{M-# M-#} to finish editing the syntax table, or 15266mode. Type @kbd{M-# M-#} to finish editing the syntax table, or
15267@kbd{M-# x} to cancel the edit. The @kbd{m m} command saves all 15267@kbd{M-# x} to cancel the edit. The @kbd{m m} command saves all
15268the syntax tables along with the other mode settings; 15268the syntax tables along with the other mode settings;
@@ -15293,7 +15293,7 @@ zero or more expressions separated by commas, and @samp{)}.''
15293A @dfn{syntax table} is a list of user-defined @dfn{syntax rules}, 15293A @dfn{syntax table} is a list of user-defined @dfn{syntax rules},
15294which allow you to specify new patterns to define your own 15294which allow you to specify new patterns to define your own
15295favorite input notations. Calc's parser always checks the syntax 15295favorite input notations. Calc's parser always checks the syntax
15296table for the current language mode, then the table for the normal 15296table for the current language mode, then the table for the Normal
15297language mode, before it uses its built-in rules to parse an 15297language mode, before it uses its built-in rules to parse an
15298algebraic formula you have entered. Each syntax rule should go on 15298algebraic formula you have entered. Each syntax rule should go on
15299its own line; it consists of a @dfn{pattern}, a @samp{:=} symbol, 15299its own line; it consists of a @dfn{pattern}, a @samp{:=} symbol,
@@ -15648,7 +15648,7 @@ In this approach, we allow @samp{#2} to equal the whole expression
15648@samp{i=1..10}. Then, we use @code{matches} to break it apart into 15648@samp{i=1..10}. Then, we use @code{matches} to break it apart into
15649its components. If the expression turns out not to match the pattern, 15649its components. If the expression turns out not to match the pattern,
15650the syntax rule will fail. Note that @kbd{Z S} always uses Calc's 15650the syntax rule will fail. Note that @kbd{Z S} always uses Calc's
15651normal language mode for editing expressions in syntax rules, so we 15651Normal language mode for editing expressions in syntax rules, so we
15652must use regular Calc notation for the interval @samp{[b..c]} that 15652must use regular Calc notation for the interval @samp{[b..c]} that
15653will correspond to the Maple mode interval @samp{1..10}. 15653will correspond to the Maple mode interval @samp{1..10}.
15654 15654
@@ -15721,11 +15721,11 @@ Polar mode. Value is 0 (rectangular) or 1 (polar); default is 0.
15721Command is @kbd{m p}. 15721Command is @kbd{m p}.
15722 15722
15723@item 15723@item
15724Matrix/scalar mode. Default value is @mathit{-1}. Value is 0 for scalar 15724Matrix/Scalar mode. Default value is @mathit{-1}. Value is 0 for Scalar
15725mode, @mathit{-2} for matrix mode, or @var{N} for 15725mode, @mathit{-2} for Matrix mode, or @var{N} for
15726@texline @math{N\times N} 15726@texline @math{N\times N}
15727@infoline @var{N}x@var{N} 15727@infoline @var{N}x@var{N}
15728matrix mode. Command is @kbd{m v}. 15728Matrix mode. Command is @kbd{m v}.
15729 15729
15730@item 15730@item
15731Simplification mode. Default is 1. Value is @mathit{-1} for off (@kbd{m O}), 15731Simplification mode. Default is 1. Value is @mathit{-1} for off (@kbd{m O}),
@@ -15760,7 +15760,7 @@ programming commands. @xref{Conditionals in Macros}.)
15760@cindex Mode line indicators 15760@cindex Mode line indicators
15761This section is a summary of all symbols that can appear on the 15761This section is a summary of all symbols that can appear on the
15762Calc mode line, the highlighted bar that appears under the Calc 15762Calc mode line, the highlighted bar that appears under the Calc
15763stack window (or under an editing window in Embedded Mode). 15763stack window (or under an editing window in Embedded mode).
15764 15764
15765The basic mode line format is: 15765The basic mode line format is:
15766 15766
@@ -15772,7 +15772,7 @@ The @samp{%%} is the Emacs symbol for ``read-only''; it shows that
15772regular Emacs commands are not allowed to edit the stack buffer 15772regular Emacs commands are not allowed to edit the stack buffer
15773as if it were text. 15773as if it were text.
15774 15774
15775The word @samp{Calc:} changes to @samp{CalcEmbed:} if Embedded Mode 15775The word @samp{Calc:} changes to @samp{CalcEmbed:} if Embedded mode
15776is enabled. The words after this describe the various Calc modes 15776is enabled. The words after this describe the various Calc modes
15777that are in effect. 15777that are in effect.
15778 15778
@@ -15800,7 +15800,7 @@ Symbolic mode (@kbd{m s}; @pxref{Symbolic Mode}).
15800Matrix mode (@kbd{m v}; @pxref{Matrix Mode}). 15800Matrix mode (@kbd{m v}; @pxref{Matrix Mode}).
15801 15801
15802@item Matrix@var{n} 15802@item Matrix@var{n}
15803Dimensioned matrix mode (@kbd{C-u @var{n} m v}). 15803Dimensioned Matrix mode (@kbd{C-u @var{n} m v}).
15804 15804
15805@item Scalar 15805@item Scalar
15806Scalar mode (@kbd{m v}; @pxref{Matrix Mode}). 15806Scalar mode (@kbd{m v}; @pxref{Matrix Mode}).
@@ -15815,7 +15815,7 @@ Fraction mode (@kbd{m f}; @pxref{Fraction Mode}).
15815Infinite mode (@kbd{m i}; @pxref{Infinite Mode}). 15815Infinite mode (@kbd{m i}; @pxref{Infinite Mode}).
15816 15816
15817@item +Inf 15817@item +Inf
15818Positive infinite mode (@kbd{C-u 0 m i}). 15818Positive Infinite mode (@kbd{C-u 0 m i}).
15819 15819
15820@item NoSimp 15820@item NoSimp
15821Default simplifications off (@kbd{m O}; @pxref{Simplification Modes}). 15821Default simplifications off (@kbd{m O}; @pxref{Simplification Modes}).
@@ -16023,14 +16023,14 @@ to every element of a vector.
16023 16023
16024If either argument of @kbd{+} is a complex number, the result will in general 16024If either argument of @kbd{+} is a complex number, the result will in general
16025be complex. If one argument is in rectangular form and the other polar, 16025be complex. If one argument is in rectangular form and the other polar,
16026the current Polar Mode determines the form of the result. If Symbolic 16026the current Polar mode determines the form of the result. If Symbolic
16027Mode is enabled, the sum may be left as a formula if the necessary 16027mode is enabled, the sum may be left as a formula if the necessary
16028conversions for polar addition are non-trivial. 16028conversions for polar addition are non-trivial.
16029 16029
16030If both arguments of @kbd{+} are HMS forms, the forms are added according to 16030If both arguments of @kbd{+} are HMS forms, the forms are added according to
16031the usual conventions of hours-minutes-seconds notation. If one argument 16031the usual conventions of hours-minutes-seconds notation. If one argument
16032is an HMS form and the other is a number, that number is converted from 16032is an HMS form and the other is a number, that number is converted from
16033degrees or radians (depending on the current Angular Mode) to HMS format 16033degrees or radians (depending on the current Angular mode) to HMS format
16034and then the two HMS forms are added. 16034and then the two HMS forms are added.
16035 16035
16036If one argument of @kbd{+} is a date form, the other can be either a 16036If one argument of @kbd{+} is a date form, the other can be either a
@@ -16182,7 +16182,7 @@ must be positive real number.
16182@tindex fdiv 16182@tindex fdiv
16183The @kbd{:} (@code{calc-fdiv}) command [@code{fdiv} function in a formula] 16183The @kbd{:} (@code{calc-fdiv}) command [@code{fdiv} function in a formula]
16184divides the two integers on the top of the stack to produce a fractional 16184divides the two integers on the top of the stack to produce a fractional
16185result. This is a convenient shorthand for enabling Fraction Mode (with 16185result. This is a convenient shorthand for enabling Fraction mode (with
16186@kbd{m f}) temporarily and using @samp{/}. Note that during numeric entry 16186@kbd{m f}) temporarily and using @samp{/}. Note that during numeric entry
16187the @kbd{:} key is interpreted as a fraction separator, so to divide 8 by 6 16187the @kbd{:} key is interpreted as a fraction separator, so to divide 8 by 6
16188you would have to type @kbd{8 @key{RET} 6 @key{RET} :}. (Of course, in 16188you would have to type @kbd{8 @key{RET} 6 @key{RET} :}. (Of course, in
@@ -16236,7 +16236,7 @@ matrix, it computes the inverse of that matrix.
16236@tindex sqrt 16236@tindex sqrt
16237The @kbd{Q} (@code{calc-sqrt}) [@code{sqrt}] command computes the square 16237The @kbd{Q} (@code{calc-sqrt}) [@code{sqrt}] command computes the square
16238root of a number. For a negative real argument, the result will be a 16238root of a number. For a negative real argument, the result will be a
16239complex number whose form is determined by the current Polar Mode. 16239complex number whose form is determined by the current Polar mode.
16240 16240
16241@kindex f h 16241@kindex f h
16242@pindex calc-hypot 16242@pindex calc-hypot
@@ -16298,7 +16298,7 @@ The @kbd{f S} (@code{calc-scale-float}) [@code{scf}] function scales a number
16298by a given power of ten. Thus, @samp{scf(mant(x), xpon(x)) = x} for any 16298by a given power of ten. Thus, @samp{scf(mant(x), xpon(x)) = x} for any
16299real @samp{x}. The second argument must be an integer, but the first 16299real @samp{x}. The second argument must be an integer, but the first
16300may actually be any numeric value. For example, @samp{scf(5,-2) = 0.05} 16300may actually be any numeric value. For example, @samp{scf(5,-2) = 0.05}
16301or @samp{1:20} depending on the current Fraction Mode. 16301or @samp{1:20} depending on the current Fraction mode.
16302 16302
16303@kindex f [ 16303@kindex f [
16304@kindex f ] 16304@kindex f ]
@@ -16482,7 +16482,7 @@ be in the range @mathit{-180} degrees (exclusive) to @mathit{+180} degrees
16482The @code{calc-imaginary} command multiplies the number on the 16482The @code{calc-imaginary} command multiplies the number on the
16483top of the stack by the imaginary number @expr{i = (0,1)}. This 16483top of the stack by the imaginary number @expr{i = (0,1)}. This
16484command is not normally bound to a key in Calc, but it is available 16484command is not normally bound to a key in Calc, but it is available
16485on the @key{IMAG} button in Keypad Mode. 16485on the @key{IMAG} button in Keypad mode.
16486 16486
16487@kindex f r 16487@kindex f r
16488@pindex calc-re 16488@pindex calc-re
@@ -17761,7 +17761,7 @@ formulas below for symbolic arguments only when you use the @kbd{a "}
17761integrals or solving equations involving the functions. 17761integrals or solving equations involving the functions.
17762 17762
17763@ifinfo 17763@ifinfo
17764These formulas are shown using the conventions of ``Big'' display 17764These formulas are shown using the conventions of Big display
17765mode (@kbd{d B}); for example, the formula for @code{fv} written 17765mode (@kbd{d B}); for example, the formula for @code{fv} written
17766linearly is @samp{pmt * ((1 + rate)^n) - 1) / rate}. 17766linearly is @samp{pmt * ((1 + rate)^n) - 1) / rate}.
17767 17767
@@ -18217,7 +18217,7 @@ to any base. For example, @kbd{1024 @key{RET} 2 B} produces 10, since
18217@infoline @expr{2^10 = 1024}. 18217@infoline @expr{2^10 = 1024}.
18218In certain cases like @samp{log(3,9)}, the result 18218In certain cases like @samp{log(3,9)}, the result
18219will be either @expr{1:2} or @expr{0.5} depending on the current Fraction 18219will be either @expr{1:2} or @expr{0.5} depending on the current Fraction
18220Mode setting. With the Inverse flag [@code{alog}], this command is 18220mode setting. With the Inverse flag [@code{alog}], this command is
18221similar to @kbd{^} except that the order of the arguments is reversed. 18221similar to @kbd{^} except that the order of the arguments is reversed.
18222 18222
18223@kindex f I 18223@kindex f I
@@ -18273,7 +18273,7 @@ of the current angular mode. @xref{Basic Operations on Units}.
18273Also, the symbolic variable @code{pi} is not ordinarily recognized in 18273Also, the symbolic variable @code{pi} is not ordinarily recognized in
18274arguments to trigonometric functions, as in @samp{sin(3 pi / 4)}, but 18274arguments to trigonometric functions, as in @samp{sin(3 pi / 4)}, but
18275the @kbd{a s} (@code{calc-simplify}) command recognizes many such 18275the @kbd{a s} (@code{calc-simplify}) command recognizes many such
18276formulas when the current angular mode is radians @emph{and} symbolic 18276formulas when the current angular mode is Radians @emph{and} Symbolic
18277mode is enabled; this example would be replaced by @samp{sqrt(2) / 2}. 18277mode is enabled; this example would be replaced by @samp{sqrt(2) / 2}.
18278@xref{Symbolic Mode}. Beware, this simplification occurs even if you 18278@xref{Symbolic Mode}. Beware, this simplification occurs even if you
18279have stored a different value in the variable @samp{pi}; this is one 18279have stored a different value in the variable @samp{pi}; this is one
@@ -18282,7 +18282,7 @@ the form @expr{x} plus a multiple of @cpiover{2} are also simplified.
18282Calc includes similar formulas for @code{cos} and @code{tan}. 18282Calc includes similar formulas for @code{cos} and @code{tan}.
18283 18283
18284The @kbd{a s} command knows all angles which are integer multiples of 18284The @kbd{a s} command knows all angles which are integer multiples of
18285@cpiover{12}, @cpiover{10}, or @cpiover{8} radians. In degrees mode, 18285@cpiover{12}, @cpiover{10}, or @cpiover{8} radians. In Degrees mode,
18286analogous simplifications occur for integer multiples of 15 or 18 18286analogous simplifications occur for integer multiples of 15 or 18
18287degrees, and for arguments plus multiples of 90 degrees. 18287degrees, and for arguments plus multiples of 90 degrees.
18288 18288
@@ -18633,7 +18633,7 @@ For @samp{arctanh(z)}: This is defined by @samp{(ln(1+z) - ln(1-z)) / 2}.
18633The branch cuts are on the real axis, less than @mathit{-1} and greater than 1. 18633The branch cuts are on the real axis, less than @mathit{-1} and greater than 1.
18634 18634
18635The following tables for @code{arcsin}, @code{arccos}, and 18635The following tables for @code{arcsin}, @code{arccos}, and
18636@code{arctan} assume the current angular mode is radians. The 18636@code{arctan} assume the current angular mode is Radians. The
18637hyperbolic functions operate independently of the angular mode. 18637hyperbolic functions operate independently of the angular mode.
18638 18638
18639@smallexample 18639@smallexample
@@ -19478,7 +19478,7 @@ Note that the prefix argument can have an effect even when the input is
19478not a vector. For example, if the input is the number @mathit{-5}, then 19478not a vector. For example, if the input is the number @mathit{-5}, then
19479@kbd{c-u -1 v u} yields @mathit{-5} and 0 (the components of @mathit{-5} 19479@kbd{c-u -1 v u} yields @mathit{-5} and 0 (the components of @mathit{-5}
19480when viewed as a rectangular complex number); @kbd{C-u -2 v u} yields 5 19480when viewed as a rectangular complex number); @kbd{C-u -2 v u} yields 5
19481and 180 (assuming degrees mode); and @kbd{C-u -10 v u} yields @mathit{-5} 19481and 180 (assuming Degrees mode); and @kbd{C-u -10 v u} yields @mathit{-5}
19482and 1 (the numerator and denominator of @mathit{-5}, viewed as a rational 19482and 1 (the numerator and denominator of @mathit{-5}, viewed as a rational
19483number). Plain @kbd{v u} with this input would complain that the input 19483number). Plain @kbd{v u} with this input would complain that the input
19484is not a composite object. 19484is not a composite object.
@@ -19608,7 +19608,7 @@ such generic identity matrices, and if one is combined with a matrix
19608whose size is known, it is converted automatically to an identity 19608whose size is known, it is converted automatically to an identity
19609matrix of a suitable matching size. The @kbd{v i} command with an 19609matrix of a suitable matching size. The @kbd{v i} command with an
19610argument of zero creates a generic identity matrix, @samp{idn(1)}. 19610argument of zero creates a generic identity matrix, @samp{idn(1)}.
19611Note that in dimensioned matrix mode (@pxref{Matrix Mode}), generic 19611Note that in dimensioned Matrix mode (@pxref{Matrix Mode}), generic
19612identity matrices are immediately expanded to the current default 19612identity matrices are immediately expanded to the current default
19613dimensions. 19613dimensions.
19614 19614
@@ -21265,11 +21265,11 @@ for anything else'') prefix.
21265using regular Emacs editing commands. 21265using regular Emacs editing commands.
21266 21266
21267When doing algebraic work, you may find several of the Calculator's 21267When doing algebraic work, you may find several of the Calculator's
21268modes to be helpful, including algebraic-simplification mode (@kbd{m A}) 21268modes to be helpful, including Algebraic Simplification mode (@kbd{m A})
21269or no-simplification mode (@kbd{m O}), 21269or No-Simplification mode (@kbd{m O}),
21270algebraic-entry mode (@kbd{m a}), fraction mode (@kbd{m f}), and 21270Algebraic entry mode (@kbd{m a}), Fraction mode (@kbd{m f}), and
21271symbolic mode (@kbd{m s}). @xref{Mode Settings}, for discussions 21271Symbolic mode (@kbd{m s}). @xref{Mode Settings}, for discussions
21272of these modes. You may also wish to select ``big'' display mode (@kbd{d B}). 21272of these modes. You may also wish to select Big display mode (@kbd{d B}).
21273@xref{Normal Language Modes}. 21273@xref{Normal Language Modes}.
21274 21274
21275@menu 21275@menu
@@ -21323,7 +21323,7 @@ sub-formula, and press @w{@kbd{j s}} (@code{calc-select-here}). Calc will
21323highlight the smallest portion of the formula that contains that 21323highlight the smallest portion of the formula that contains that
21324character. By default the sub-formula is highlighted by blanking out 21324character. By default the sub-formula is highlighted by blanking out
21325all of the rest of the formula with dots. Selection works in any 21325all of the rest of the formula with dots. Selection works in any
21326display mode but is perhaps easiest in ``big'' (@kbd{d B}) mode. 21326display mode but is perhaps easiest in Big mode (@kbd{d B}).
21327Suppose you enter the following formula: 21327Suppose you enter the following formula:
21328 21328
21329@smallexample 21329@smallexample
@@ -21353,7 +21353,7 @@ to
21353Every character not part of the sub-formula @samp{b} has been changed 21353Every character not part of the sub-formula @samp{b} has been changed
21354to a dot. The @samp{*} next to the line number is to remind you that 21354to a dot. The @samp{*} next to the line number is to remind you that
21355the formula has a portion of it selected. (In this case, it's very 21355the formula has a portion of it selected. (In this case, it's very
21356obvious, but it might not always be. If Embedded Mode is enabled, 21356obvious, but it might not always be. If Embedded mode is enabled,
21357the word @samp{Sel} also appears in the mode line because the stack 21357the word @samp{Sel} also appears in the mode line because the stack
21358may not be visible. @pxref{Embedded Mode}.) 21358may not be visible. @pxref{Embedded Mode}.)
21359 21359
@@ -22003,9 +22003,9 @@ but which also substitutes stored values for variables in the formula.
22003Use @kbd{a v} if you want the variables to ignore their stored values. 22003Use @kbd{a v} if you want the variables to ignore their stored values.
22004 22004
22005If you give a numeric prefix argument of 2 to @kbd{a v}, it simplifies 22005If you give a numeric prefix argument of 2 to @kbd{a v}, it simplifies
22006as if in algebraic simplification mode. This is equivalent to typing 22006as if in Algebraic Simplification mode. This is equivalent to typing
22007@kbd{a s}; @pxref{Simplifying Formulas}. If you give a numeric prefix 22007@kbd{a s}; @pxref{Simplifying Formulas}. If you give a numeric prefix
22008of 3 or more, it uses extended simplification mode (@kbd{a e}). 22008of 3 or more, it uses Extended Simplification mode (@kbd{a e}).
22009 22009
22010If you give a negative prefix argument @mathit{-1}, @mathit{-2}, or @mathit{-3}, 22010If you give a negative prefix argument @mathit{-1}, @mathit{-2}, or @mathit{-3},
22011it simplifies in the corresponding mode but only works on the top-level 22011it simplifies in the corresponding mode but only works on the top-level
@@ -22013,7 +22013,7 @@ function call of the formula. For example, @samp{(2 + 3) * (2 + 3)} will
22013simplify to @samp{(2 + 3)^2}, without simplifying the sub-formulas 22013simplify to @samp{(2 + 3)^2}, without simplifying the sub-formulas
22014@samp{2 + 3}. As another example, typing @kbd{V R +} to sum the vector 22014@samp{2 + 3}. As another example, typing @kbd{V R +} to sum the vector
22015@samp{[1, 2, 3, 4]} produces the formula @samp{reduce(add, [1, 2, 3, 4])} 22015@samp{[1, 2, 3, 4]} produces the formula @samp{reduce(add, [1, 2, 3, 4])}
22016in no-simplify mode. Using @kbd{a v} will evaluate this all the way to 22016in No-Simplify mode. Using @kbd{a v} will evaluate this all the way to
2201710; using @kbd{C-u - a v} will evaluate it only to @samp{1 + 2 + 3 + 4}. 2201710; using @kbd{C-u - a v} will evaluate it only to @samp{1 + 2 + 3 + 4}.
22018(@xref{Reducing and Mapping}.) 22018(@xref{Reducing and Mapping}.)
22019 22019
@@ -22021,7 +22021,7 @@ in no-simplify mode. Using @kbd{a v} will evaluate this all the way to
22021@tindex evalvn 22021@tindex evalvn
22022The @kbd{=} command corresponds to the @code{evalv} function, and 22022The @kbd{=} command corresponds to the @code{evalv} function, and
22023the related @kbd{N} command, which is like @kbd{=} but temporarily 22023the related @kbd{N} command, which is like @kbd{=} but temporarily
22024disables symbolic (@kbd{m s}) mode during the evaluation, corresponds 22024disables Symbolic mode (@kbd{m s}) during the evaluation, corresponds
22025to the @code{evalvn} function. (These commands interpret their prefix 22025to the @code{evalvn} function. (These commands interpret their prefix
22026arguments differently than @kbd{a v}; @kbd{=} treats the prefix as 22026arguments differently than @kbd{a v}; @kbd{=} treats the prefix as
22027the number of stack elements to evaluate at once, and @kbd{N} treats 22027the number of stack elements to evaluate at once, and @kbd{N} treats
@@ -22196,7 +22196,7 @@ is evaluated to @expr{3}. Evaluation does not occur if the arguments
22196to a function are somehow of the wrong type @expr{@t{tan}([2,3,4])}), 22196to a function are somehow of the wrong type @expr{@t{tan}([2,3,4])}),
22197range (@expr{@t{tan}(90)}), or number (@expr{@t{tan}(3,5)}), 22197range (@expr{@t{tan}(90)}), or number (@expr{@t{tan}(3,5)}),
22198or if the function name is not recognized (@expr{@t{f}(5)}), or if 22198or if the function name is not recognized (@expr{@t{f}(5)}), or if
22199``symbolic'' mode (@pxref{Symbolic Mode}) prevents evaluation 22199Symbolic mode (@pxref{Symbolic Mode}) prevents evaluation
22200(@expr{@t{sqrt}(2)}). 22200(@expr{@t{sqrt}(2)}).
22201 22201
22202Calc simplifies (evaluates) the arguments to a function before it 22202Calc simplifies (evaluates) the arguments to a function before it
@@ -22304,7 +22304,7 @@ to @expr{-a}.
22304The products @expr{1 a} and @expr{a 1} are simplified to @expr{a}; 22304The products @expr{1 a} and @expr{a 1} are simplified to @expr{a};
22305@expr{(-1) a} and @expr{a (-1)} are simplified to @expr{-a}; 22305@expr{(-1) a} and @expr{a (-1)} are simplified to @expr{-a};
22306@expr{0 a} and @expr{a 0} are simplified to @expr{0}, except that 22306@expr{0 a} and @expr{a 0} are simplified to @expr{0}, except that
22307in matrix mode where @expr{a} is not provably scalar the result 22307in Matrix mode where @expr{a} is not provably scalar the result
22308is the generic zero matrix @samp{idn(0)}, and that if @expr{a} is 22308is the generic zero matrix @samp{idn(0)}, and that if @expr{a} is
22309infinite the result is @samp{nan}. 22309infinite the result is @samp{nan}.
22310 22310
@@ -22330,18 +22330,18 @@ or the implicit one-half of @expr{@t{sqrt}(x)}, and similarly for
22330@expr{b}. The result is written using @samp{sqrt} or @samp{1/sqrt} 22330@expr{b}. The result is written using @samp{sqrt} or @samp{1/sqrt}
22331if the sum of the powers is @expr{1/2} or @expr{-1/2}, respectively. 22331if the sum of the powers is @expr{1/2} or @expr{-1/2}, respectively.
22332If the sum of the powers is zero, the product is simplified to 22332If the sum of the powers is zero, the product is simplified to
22333@expr{1} or to @samp{idn(1)} if matrix mode is enabled. 22333@expr{1} or to @samp{idn(1)} if Matrix mode is enabled.
22334 22334
22335The product of a negative power times anything but another negative 22335The product of a negative power times anything but another negative
22336power is changed to use division: 22336power is changed to use division:
22337@texline @math{x^{-2} y} 22337@texline @math{x^{-2} y}
22338@infoline @expr{x^(-2) y} 22338@infoline @expr{x^(-2) y}
22339goes to @expr{y / x^2} unless matrix mode is 22339goes to @expr{y / x^2} unless Matrix mode is
22340in effect and neither @expr{x} nor @expr{y} are scalar (in which 22340in effect and neither @expr{x} nor @expr{y} are scalar (in which
22341case it is considered unsafe to rearrange the order of the terms). 22341case it is considered unsafe to rearrange the order of the terms).
22342 22342
22343Finally, @expr{a (b/c)} is rewritten to @expr{(a b)/c}, and also 22343Finally, @expr{a (b/c)} is rewritten to @expr{(a b)/c}, and also
22344@expr{(a/b) c} is changed to @expr{(a c)/b} unless in matrix mode. 22344@expr{(a/b) c} is changed to @expr{(a c)/b} unless in Matrix mode.
22345 22345
22346@tex 22346@tex
22347\bigskip 22347\bigskip
@@ -22368,7 +22368,7 @@ for any power @expr{c}.
22368 22368
22369Also, @expr{(-a) / b} and @expr{a / (-b)} go to @expr{-(a/b)}; 22369Also, @expr{(-a) / b} and @expr{a / (-b)} go to @expr{-(a/b)};
22370@expr{(a/b) / c} goes to @expr{a / (b c)}; and @expr{a / (b/c)} 22370@expr{(a/b) / c} goes to @expr{a / (b c)}; and @expr{a / (b/c)}
22371goes to @expr{(a c) / b} unless matrix mode prevents this 22371goes to @expr{(a c) / b} unless Matrix mode prevents this
22372rearrangement. Similarly, @expr{a / (b:c)} is simplified to 22372rearrangement. Similarly, @expr{a / (b:c)} is simplified to
22373@expr{(c:b) a} for any fraction @expr{b:c}. 22373@expr{(c:b) a} for any fraction @expr{b:c}.
22374 22374
@@ -22392,7 +22392,7 @@ to @expr{a / (c - b)}, and @expr{(a - b) / (-c)} to @expr{(b - a) / c}.
22392@end tex 22392@end tex
22393 22393
22394The formula @expr{x^0} is simplified to @expr{1}, or to @samp{idn(1)} 22394The formula @expr{x^0} is simplified to @expr{1}, or to @samp{idn(1)}
22395in matrix mode. The formula @expr{0^x} is simplified to @expr{0} 22395in Matrix mode. The formula @expr{0^x} is simplified to @expr{0}
22396unless @expr{x} is a negative number or complex number, in which 22396unless @expr{x} is a negative number or complex number, in which
22397case the result is an infinity or an unsimplified formula according 22397case the result is an infinity or an unsimplified formula according
22398to the current infinite mode. Note that @expr{0^0} is an 22398to the current infinite mode. Note that @expr{0^0} is an
@@ -22568,7 +22568,7 @@ property that real-valued numbers, interval forms and infinities
22568come first, and are sorted into increasing order. The @kbd{V S} 22568come first, and are sorted into increasing order. The @kbd{V S}
22569command uses the same ordering when sorting a vector. 22569command uses the same ordering when sorting a vector.
22570 22570
22571Sorting of terms of products is inhibited when matrix mode is 22571Sorting of terms of products is inhibited when Matrix mode is
22572turned on; in this case, Calc will never exchange the order of 22572turned on; in this case, Calc will never exchange the order of
22573two terms unless it knows at least one of the terms is a scalar. 22573two terms unless it knows at least one of the terms is a scalar.
22574 22574
@@ -23176,7 +23176,7 @@ With a numeric prefix argument @var{n}, this command computes the
23176@var{n}th derivative. 23176@var{n}th derivative.
23177 23177
23178When working with trigonometric functions, it is best to switch to 23178When working with trigonometric functions, it is best to switch to
23179radians mode first (with @w{@kbd{m r}}). The derivative of @samp{sin(x)} 23179Radians mode first (with @w{@kbd{m r}}). The derivative of @samp{sin(x)}
23180in degrees is @samp{(pi/180) cos(x)}, probably not the expected 23180in degrees is @samp{(pi/180) cos(x)}, probably not the expected
23181answer! 23181answer!
23182 23182
@@ -23267,7 +23267,7 @@ due to a different choice of constant of integration.
23267 23267
23268The Calculator remembers all the integrals it has done. If conditions 23268The Calculator remembers all the integrals it has done. If conditions
23269change in a way that would invalidate the old integrals, say, a switch 23269change in a way that would invalidate the old integrals, say, a switch
23270from degrees to radians mode, then they will be thrown out. If you 23270from Degrees to Radians mode, then they will be thrown out. If you
23271suspect this is not happening when it should, use the 23271suspect this is not happening when it should, use the
23272@code{calc-flush-caches} command; @pxref{Caches}. 23272@code{calc-flush-caches} command; @pxref{Caches}.
23273 23273
@@ -23626,10 +23626,10 @@ which can be solved for @expr{x^3} using the quadratic equation, and then
23626for @expr{x} by taking cube roots. But in many cases, like 23626for @expr{x} by taking cube roots. But in many cases, like
23627@expr{x^6 + x + 1}, Calc does not know how to rewrite the polynomial 23627@expr{x^6 + x + 1}, Calc does not know how to rewrite the polynomial
23628into a form it can solve. The @kbd{a P} command can still deliver a 23628into a form it can solve. The @kbd{a P} command can still deliver a
23629list of numerical roots, however, provided that symbolic mode (@kbd{m s}) 23629list of numerical roots, however, provided that Symbolic mode (@kbd{m s})
23630is not turned on. (If you work with symbolic mode on, recall that the 23630is not turned on. (If you work with Symbolic mode on, recall that the
23631@kbd{N} (@code{calc-eval-num}) key is a handy way to reevaluate the 23631@kbd{N} (@code{calc-eval-num}) key is a handy way to reevaluate the
23632formula on the stack with symbolic mode temporarily off.) Naturally, 23632formula on the stack with Symbolic mode temporarily off.) Naturally,
23633@kbd{a P} can only provide numerical roots if the polynomial coefficients 23633@kbd{a P} can only provide numerical roots if the polynomial coefficients
23634are all numbers (real or complex). 23634are all numbers (real or complex).
23635 23635
@@ -24244,9 +24244,9 @@ Note that since the constant and linear terms are enough to fit the
24244data exactly, it's no surprise that Calc chose a tiny contribution 24244data exactly, it's no surprise that Calc chose a tiny contribution
24245for @expr{x^2}. (The fact that it's not exactly zero is due only 24245for @expr{x^2}. (The fact that it's not exactly zero is due only
24246to roundoff error. Since our data are exact integers, we could get 24246to roundoff error. Since our data are exact integers, we could get
24247an exact answer by typing @kbd{m f} first to get fraction mode. 24247an exact answer by typing @kbd{m f} first to get Fraction mode.
24248Then the @expr{x^2} term would vanish altogether. Usually, though, 24248Then the @expr{x^2} term would vanish altogether. Usually, though,
24249the data being fitted will be approximate floats so fraction mode 24249the data being fitted will be approximate floats so Fraction mode
24250won't help.) 24250won't help.)
24251 24251
24252Doing the @kbd{a F 2} fit on the data set with 14 instead of 13 24252Doing the @kbd{a F 2} fit on the data set with 14 instead of 13
@@ -24271,7 +24271,7 @@ The actual coefficients we get with a precision of 12, like
24271@expr{0.0416666663588}, clearly suffer from loss of precision. 24271@expr{0.0416666663588}, clearly suffer from loss of precision.
24272It is a good idea to increase the working precision to several 24272It is a good idea to increase the working precision to several
24273digits beyond what you need when you do a fitting operation. 24273digits beyond what you need when you do a fitting operation.
24274Or, if your data are exact, use fraction mode to get exact 24274Or, if your data are exact, use Fraction mode to get exact
24275results. 24275results.
24276 24276
24277You can type @kbd{i} instead of a digit at the model prompt to fit 24277You can type @kbd{i} instead of a digit at the model prompt to fit
@@ -25942,12 +25942,12 @@ like @samp{(x + y) + (z - w)}, are not tried.
25942 25942
25943Note that @samp{*} is not commutative when applied to matrices, but 25943Note that @samp{*} is not commutative when applied to matrices, but
25944rewrite rules pretend that it is. If you type @kbd{m v} to enable 25944rewrite rules pretend that it is. If you type @kbd{m v} to enable
25945matrix mode (@pxref{Matrix Mode}), rewrite rules will match @samp{*} 25945Matrix mode (@pxref{Matrix Mode}), rewrite rules will match @samp{*}
25946literally, ignoring its usual commutativity property. (In the 25946literally, ignoring its usual commutativity property. (In the
25947current implementation, the associativity also vanishes---it is as 25947current implementation, the associativity also vanishes---it is as
25948if the pattern had been enclosed in a @code{plain} marker; see below.) 25948if the pattern had been enclosed in a @code{plain} marker; see below.)
25949If you are applying rewrites to formulas with matrices, it's best to 25949If you are applying rewrites to formulas with matrices, it's best to
25950enable matrix mode first to prevent algebraically incorrect rewrites 25950enable Matrix mode first to prevent algebraically incorrect rewrites
25951from occurring. 25951from occurring.
25952 25952
25953The pattern @samp{-x} will actually match any expression. For example, 25953The pattern @samp{-x} will actually match any expression. For example,
@@ -26424,8 +26424,8 @@ You must use @code{apply} for meta-variables with function names
26424on both sides of a rewrite rule: @samp{apply(f, [x]) := f(x+1)} 26424on both sides of a rewrite rule: @samp{apply(f, [x]) := f(x+1)}
26425is @emph{not} correct, because it rewrites @samp{spam(6)} into 26425is @emph{not} correct, because it rewrites @samp{spam(6)} into
26426@samp{f(7)}. The righthand side should be @samp{apply(f, [x+1])}. 26426@samp{f(7)}. The righthand side should be @samp{apply(f, [x+1])}.
26427Also note that you will have to use no-simplify (@kbd{m O}) 26427Also note that you will have to use No-Simplify mode (@kbd{m O})
26428mode when entering this rule so that the @code{apply} isn't 26428when entering this rule so that the @code{apply} isn't
26429evaluated immediately to get the new rule @samp{f(x) := f(x+1)}. 26429evaluated immediately to get the new rule @samp{f(x) := f(x+1)}.
26430Or, use @kbd{s e} to enter the rule without going through the stack, 26430Or, use @kbd{s e} to enter the rule without going through the stack,
26431or enter the rule as @samp{apply(f, [x]) := apply(f, [x+1]) @w{:: 1}}. 26431or enter the rule as @samp{apply(f, [x]) := apply(f, [x+1]) @w{:: 1}}.
@@ -27160,7 +27160,7 @@ To apply these manually, you could put them in a variable called
27160to expand trig functions. But if instead you store them in the 27160to expand trig functions. But if instead you store them in the
27161variable @code{EvalRules}, they will automatically be applied to all 27161variable @code{EvalRules}, they will automatically be applied to all
27162sines and cosines of sums. Then, with @samp{2 x} and @samp{45} on 27162sines and cosines of sums. Then, with @samp{2 x} and @samp{45} on
27163the stack, typing @kbd{+ S} will (assuming degrees mode) result in 27163the stack, typing @kbd{+ S} will (assuming Degrees mode) result in
27164@samp{0.7071 sin(2 x) + 0.7071 cos(2 x)} automatically. 27164@samp{0.7071 sin(2 x) + 0.7071 cos(2 x)} automatically.
27165 27165
27166As each level of a formula is evaluated, the rules from 27166As each level of a formula is evaluated, the rules from
@@ -27236,11 +27236,11 @@ number @expr{(2, 3)}, Calc computes @samp{sqrt(2*2 + 3*3)} by calling
27236the multiplication, addition, and square root functions directly rather 27236the multiplication, addition, and square root functions directly rather
27237than applying the default simplifications to this formula. So an 27237than applying the default simplifications to this formula. So an
27238@code{EvalRules} rule that (perversely) rewrites @samp{sqrt(13) := 6} 27238@code{EvalRules} rule that (perversely) rewrites @samp{sqrt(13) := 6}
27239would not apply. (However, if you put Calc into symbolic mode so that 27239would not apply. (However, if you put Calc into Symbolic mode so that
27240@samp{sqrt(13)} will be left in symbolic form by the built-in square 27240@samp{sqrt(13)} will be left in symbolic form by the built-in square
27241root function, your rule will be able to apply. But if the complex 27241root function, your rule will be able to apply. But if the complex
27242number were @expr{(3,4)}, so that @samp{sqrt(25)} must be calculated, 27242number were @expr{(3,4)}, so that @samp{sqrt(25)} must be calculated,
27243then symbolic mode will not help because @samp{sqrt(25)} can be 27243then Symbolic mode will not help because @samp{sqrt(25)} can be
27244evaluated exactly to 5.) 27244evaluated exactly to 5.)
27245 27245
27246One subtle restriction that normally only manifests itself with 27246One subtle restriction that normally only manifests itself with
@@ -27347,7 +27347,7 @@ A surprisingly useful rewrite rule is @samp{a/(b-c) := a*(b+c)/(b^2-c^2)}.
27347This will simplify the formula whenever @expr{b} and/or @expr{c} can 27347This will simplify the formula whenever @expr{b} and/or @expr{c} can
27348be made simpler by squaring. For example, applying this rule to 27348be made simpler by squaring. For example, applying this rule to
27349@samp{2 / (sqrt(2) + 3)} yields @samp{6:7 - 2:7 sqrt(2)} (assuming 27349@samp{2 / (sqrt(2) + 3)} yields @samp{6:7 - 2:7 sqrt(2)} (assuming
27350Symbolic Mode has been enabled to keep the square root from being 27350Symbolic mode has been enabled to keep the square root from being
27351evaluated to a floating-point approximation). This rule is also 27351evaluated to a floating-point approximation). This rule is also
27352useful when working with symbolic complex numbers, e.g., 27352useful when working with symbolic complex numbers, e.g.,
27353@samp{(a + b i) / (c + d i)}. 27353@samp{(a + b i) / (c + d i)}.
@@ -27457,7 +27457,7 @@ formula @samp{1 mm} is ``simplified'' to @samp{mm}. This is only a
27457display anomaly, however; @samp{mm} will work just fine as a 27457display anomaly, however; @samp{mm} will work just fine as a
27458representation of one millimeter. 27458representation of one millimeter.
27459 27459
27460You may find that Algebraic Mode (@pxref{Algebraic Entry}) makes working 27460You may find that Algebraic mode (@pxref{Algebraic Entry}) makes working
27461with units expressions easier. Otherwise, you will have to remember 27461with units expressions easier. Otherwise, you will have to remember
27462to hit the apostrophe key every time you wish to enter units. 27462to hit the apostrophe key every time you wish to enter units.
27463 27463
@@ -28346,11 +28346,11 @@ including the current simplification mode. Recall that the
28346formula @samp{x + y + x} is not handled by Calc's default 28346formula @samp{x + y + x} is not handled by Calc's default
28347simplifications, but the @kbd{a s} command will reduce it to 28347simplifications, but the @kbd{a s} command will reduce it to
28348the simpler form @samp{y + 2 x}. You can also type @kbd{m A} 28348the simpler form @samp{y + 2 x}. You can also type @kbd{m A}
28349to enable an algebraic-simplification mode in which the 28349to enable an Algebraic Simplification mode in which the
28350equivalent of @kbd{a s} is used on all of Calc's results. 28350equivalent of @kbd{a s} is used on all of Calc's results.
28351If you enter @samp{x + y + x =>} normally, the result will 28351If you enter @samp{x + y + x =>} normally, the result will
28352be @samp{x + y + x => x + y + x}. If you change to 28352be @samp{x + y + x => x + y + x}. If you change to
28353algebraic-simplification mode, the result will be 28353Algebraic Simplification mode, the result will be
28354@samp{x + y + x => y + 2 x}. However, just pressing @kbd{a s} 28354@samp{x + y + x => y + 2 x}. However, just pressing @kbd{a s}
28355once will have no effect on @samp{x + y + x => x + y + x}, 28355once will have no effect on @samp{x + y + x => x + y + x},
28356because the righthand side depends only on the lefthand side 28356because the righthand side depends only on the lefthand side
@@ -28389,13 +28389,13 @@ side effects.
28389@pindex calc-assign 28389@pindex calc-assign
28390@tindex assign 28390@tindex assign
28391@tindex := 28391@tindex :=
28392Embedded Mode also uses @samp{=>} operators. In embedded mode, 28392Embedded mode also uses @samp{=>} operators. In Embedded mode,
28393the lefthand side of an @samp{=>} operator can refer to variables 28393the lefthand side of an @samp{=>} operator can refer to variables
28394assigned elsewhere in the file by @samp{:=} operators. The 28394assigned elsewhere in the file by @samp{:=} operators. The
28395assignment operator @samp{a := 17} does not actually do anything 28395assignment operator @samp{a := 17} does not actually do anything
28396by itself. But Embedded Mode recognizes it and marks it as a sort 28396by itself. But Embedded mode recognizes it and marks it as a sort
28397of file-local definition of the variable. You can enter @samp{:=} 28397of file-local definition of the variable. You can enter @samp{:=}
28398operators in algebraic mode, or by using the @kbd{s :} 28398operators in Algebraic mode, or by using the @kbd{s :}
28399(@code{calc-assign}) [@code{assign}] command which takes a variable 28399(@code{calc-assign}) [@code{assign}] command which takes a variable
28400and value from the stack and replaces them with an assignment. 28400and value from the stack and replaces them with an assignment.
28401 28401
@@ -29096,7 +29096,7 @@ killing GNUPLOT because you think it has gotten stuck.
29096The commands in this chapter move information between the Calculator and 29096The commands in this chapter move information between the Calculator and
29097other Emacs editing buffers. 29097other Emacs editing buffers.
29098 29098
29099In many cases Embedded Mode is an easier and more natural way to 29099In many cases Embedded mode is an easier and more natural way to
29100work with Calc from a regular editing buffer. @xref{Embedded Mode}. 29100work with Calc from a regular editing buffer. @xref{Embedded Mode}.
29101 29101
29102@menu 29102@menu
@@ -29367,7 +29367,7 @@ just by double-clicking on it in the shell, then middle-clicking
29367in the Calc window. 29367in the Calc window.
29368 29368
29369@node Keypad Mode, Embedded Mode, Kill and Yank, Introduction 29369@node Keypad Mode, Embedded Mode, Kill and Yank, Introduction
29370@chapter ``Keypad'' Mode 29370@chapter Keypad Mode
29371 29371
29372@noindent 29372@noindent
29373@kindex M-# k 29373@kindex M-# k
@@ -29376,7 +29376,7 @@ The @kbd{M-# k} (@code{calc-keypad}) command starts the Calculator
29376and displays a picture of a calculator-style keypad. If you are using 29376and displays a picture of a calculator-style keypad. If you are using
29377the X window system, you can click on any of the ``keys'' in the 29377the X window system, you can click on any of the ``keys'' in the
29378keypad using the left mouse button to operate the calculator. 29378keypad using the left mouse button to operate the calculator.
29379The original window remains the selected window; in keypad mode 29379The original window remains the selected window; in Keypad mode
29380you can type in your file while simultaneously performing 29380you can type in your file while simultaneously performing
29381calculations with the mouse. 29381calculations with the mouse.
29382 29382
@@ -29392,11 +29392,11 @@ the @samp{*Calc Keypad*} window, place the cursor on the desired
29392``key,'' and type @key{SPC} or @key{RET}. If you think this 29392``key,'' and type @key{SPC} or @key{RET}. If you think this
29393is easier than using Calc normally, go right ahead. 29393is easier than using Calc normally, go right ahead.
29394 29394
29395Calc commands are more or less the same in keypad mode. Certain 29395Calc commands are more or less the same in Keypad mode. Certain
29396keypad keys differ slightly from the corresponding normal Calc 29396keypad keys differ slightly from the corresponding normal Calc
29397keystrokes; all such deviations are described below. 29397keystrokes; all such deviations are described below.
29398 29398
29399Keypad Mode includes many more commands than will fit on the keypad 29399Keypad mode includes many more commands than will fit on the keypad
29400at once. Click the right mouse button [@code{calc-keypad-menu}] 29400at once. Click the right mouse button [@code{calc-keypad-menu}]
29401to switch to the next menu. The bottom five rows of the keypad 29401to switch to the next menu. The bottom five rows of the keypad
29402stay the same; the top three rows change to a new set of commands. 29402stay the same; the top three rows change to a new set of commands.
@@ -29444,7 +29444,7 @@ original buffer.
29444@end smallexample 29444@end smallexample
29445 29445
29446@noindent 29446@noindent
29447This is the menu that appears the first time you start Keypad Mode. 29447This is the menu that appears the first time you start Keypad mode.
29448It will show up in a vertical window on the right side of your screen. 29448It will show up in a vertical window on the right side of your screen.
29449Above this menu is the traditional Calc stack display. On a 24-line 29449Above this menu is the traditional Calc stack display. On a 24-line
29450screen you will be able to see the top three stack entries. 29450screen you will be able to see the top three stack entries.
@@ -29461,7 +29461,7 @@ At other times it changes the sign of the number on the top of the
29461stack. 29461stack.
29462 29462
29463The @key{INV} and @key{HYP} keys modify other keys. As well as 29463The @key{INV} and @key{HYP} keys modify other keys. As well as
29464having the effects described elsewhere in this manual, Keypad Mode 29464having the effects described elsewhere in this manual, Keypad mode
29465defines several other ``inverse'' operations. These are described 29465defines several other ``inverse'' operations. These are described
29466below and in the following sections. 29466below and in the following sections.
29467 29467
@@ -29481,7 +29481,7 @@ The @key{EXEC} key prompts you to enter any keystroke sequence
29481that would normally work in Calc mode. This can include a 29481that would normally work in Calc mode. This can include a
29482numeric prefix if you wish. It is also possible simply to 29482numeric prefix if you wish. It is also possible simply to
29483switch into the Calc window and type commands in it; there is 29483switch into the Calc window and type commands in it; there is
29484nothing ``magic'' about this window when Keypad Mode is active. 29484nothing ``magic'' about this window when Keypad mode is active.
29485 29485
29486The other keys in this display perform their obvious calculator 29486The other keys in this display perform their obvious calculator
29487functions. @key{CLN2} rounds the top-of-stack by temporarily 29487functions. @key{CLN2} rounds the top-of-stack by temporarily
@@ -29760,16 +29760,16 @@ The @key{OVER} key duplicates the second-to-top stack element.
29760The @key{STO} and @key{RCL} keys are analogous to @kbd{s t} and 29760The @key{STO} and @key{RCL} keys are analogous to @kbd{s t} and
29761@kbd{s r} in regular Calc. @xref{Store and Recall}. Click the 29761@kbd{s r} in regular Calc. @xref{Store and Recall}. Click the
29762@key{STO} or @key{RCL} key, then one of the ten digits. (Named 29762@key{STO} or @key{RCL} key, then one of the ten digits. (Named
29763variables are not available in Keypad Mode.) You can also use, 29763variables are not available in Keypad mode.) You can also use,
29764for example, @kbd{STO + 3} to add to register 3. 29764for example, @kbd{STO + 3} to add to register 3.
29765 29765
29766@node Embedded Mode, Programming, Keypad Mode, Top 29766@node Embedded Mode, Programming, Keypad Mode, Top
29767@chapter Embedded Mode 29767@chapter Embedded Mode
29768 29768
29769@noindent 29769@noindent
29770Embedded Mode in Calc provides an alternative to copying numbers 29770Embedded mode in Calc provides an alternative to copying numbers
29771and formulas back and forth between editing buffers and the Calc 29771and formulas back and forth between editing buffers and the Calc
29772stack. In Embedded Mode, your editing buffer becomes temporarily 29772stack. In Embedded mode, your editing buffer becomes temporarily
29773linked to the stack and this copying is taken care of automatically. 29773linked to the stack and this copying is taken care of automatically.
29774 29774
29775@menu 29775@menu
@@ -29794,7 +29794,7 @@ are visiting your own files.
29794 29794
29795Calc normally scans backward and forward in the buffer for the 29795Calc normally scans backward and forward in the buffer for the
29796nearest opening and closing @dfn{formula delimiters}. The simplest 29796nearest opening and closing @dfn{formula delimiters}. The simplest
29797delimiters are blank lines. Other delimiters that Embedded Mode 29797delimiters are blank lines. Other delimiters that Embedded mode
29798understands are: 29798understands are:
29799 29799
29800@enumerate 29800@enumerate
@@ -30352,15 +30352,15 @@ use @kbd{M-# u} to update the buffer by hand.
30352@section Mode Settings in Embedded Mode 30352@section Mode Settings in Embedded Mode
30353 30353
30354@noindent 30354@noindent
30355Embedded Mode has a rather complicated mechanism for handling mode 30355Embedded mode has a rather complicated mechanism for handling mode
30356settings in Embedded formulas. It is possible to put annotations 30356settings in Embedded formulas. It is possible to put annotations
30357in the file that specify mode settings either global to the entire 30357in the file that specify mode settings either global to the entire
30358file or local to a particular formula or formulas. In the latter 30358file or local to a particular formula or formulas. In the latter
30359case, different modes can be specified for use when a formula 30359case, different modes can be specified for use when a formula
30360is the enabled Embedded Mode formula. 30360is the enabled Embedded mode formula.
30361 30361
30362When you give any mode-setting command, like @kbd{m f} (for fraction 30362When you give any mode-setting command, like @kbd{m f} (for Fraction
30363mode) or @kbd{d s} (for scientific notation), Embedded Mode adds 30363mode) or @kbd{d s} (for scientific notation), Embedded mode adds
30364a line like the following one to the file just before the opening 30364a line like the following one to the file just before the opening
30365delimiter of the formula. 30365delimiter of the formula.
30366 30366
@@ -30413,7 +30413,7 @@ sure the value is of a legal type or range; if you write an
30413annotation by hand, be sure to give a proper value or results 30413annotation by hand, be sure to give a proper value or results
30414will be unpredictable. Mode-setting annotations are case-sensitive. 30414will be unpredictable. Mode-setting annotations are case-sensitive.
30415 30415
30416While Embedded Mode is enabled, the word @code{Local} appears in 30416While Embedded mode is enabled, the word @code{Local} appears in
30417the mode line. This is to show that mode setting commands generate 30417the mode line. This is to show that mode setting commands generate
30418annotations that are ``local'' to the current formula or set of 30418annotations that are ``local'' to the current formula or set of
30419formulas. The @kbd{m R} (@code{calc-mode-record-mode}) command 30419formulas. The @kbd{m R} (@code{calc-mode-record-mode}) command
@@ -30429,7 +30429,7 @@ that look like this, respectively:
30429@end example 30429@end example
30430 30430
30431The first kind of annotation will be used only while a formula 30431The first kind of annotation will be used only while a formula
30432is enabled in Embedded Mode. The second kind will be used only 30432is enabled in Embedded mode. The second kind will be used only
30433when the formula is @emph{not} enabled. (Whether the formula 30433when the formula is @emph{not} enabled. (Whether the formula
30434is ``active'' or not, i.e., whether Calc has seen this formula 30434is ``active'' or not, i.e., whether Calc has seen this formula
30435yet, is not relevant here.) 30435yet, is not relevant here.)
@@ -30471,21 +30471,21 @@ We would have to go down to the other formula and press @kbd{M-# u}
30471on it in order to get it to notice the new annotation. 30471on it in order to get it to notice the new annotation.
30472 30472
30473Two more mode-recording modes selectable by @kbd{m R} are @code{Save} 30473Two more mode-recording modes selectable by @kbd{m R} are @code{Save}
30474(which works even outside of Embedded Mode), in which mode settings 30474(which works even outside of Embedded mode), in which mode settings
30475are recorded permanently in your Emacs startup file @file{~/.emacs} 30475are recorded permanently in your Emacs startup file @file{~/.emacs}
30476rather than by annotating the current document, and no-recording 30476rather than by annotating the current document, and no-recording
30477mode (where there is no symbol like @code{Save} or @code{Local} in 30477mode (where there is no symbol like @code{Save} or @code{Local} in
30478the mode line), in which mode-changing commands do not leave any 30478the mode line), in which mode-changing commands do not leave any
30479annotations at all. 30479annotations at all.
30480 30480
30481When Embedded Mode is not enabled, mode-recording modes except 30481When Embedded mode is not enabled, mode-recording modes except
30482for @code{Save} have no effect. 30482for @code{Save} have no effect.
30483 30483
30484@node Customizing Embedded Mode, , Mode Settings in Embedded Mode, Embedded Mode 30484@node Customizing Embedded Mode, , Mode Settings in Embedded Mode, Embedded Mode
30485@section Customizing Embedded Mode 30485@section Customizing Embedded Mode
30486 30486
30487@noindent 30487@noindent
30488You can modify Embedded Mode's behavior by setting various Lisp 30488You can modify Embedded mode's behavior by setting various Lisp
30489variables described here. Use @kbd{M-x set-variable} or 30489variables described here. Use @kbd{M-x set-variable} or
30490@kbd{M-x edit-options} to adjust a variable on the fly, or 30490@kbd{M-x edit-options} to adjust a variable on the fly, or
30491put a suitable @code{setq} statement in your @file{~/.emacs} 30491put a suitable @code{setq} statement in your @file{~/.emacs}
@@ -30495,7 +30495,7 @@ file; @pxref{File Variables, , Local Variables in Files, emacs, the
30495Emacs manual}.) 30495Emacs manual}.)
30496 30496
30497While none of these variables will be buffer-local by default, you 30497While none of these variables will be buffer-local by default, you
30498can make any of them local to any embedded-mode buffer. (Their 30498can make any of them local to any Embedded mode buffer. (Their
30499values in the @samp{*Calculator*} buffer are never used.) 30499values in the @samp{*Calculator*} buffer are never used.)
30500 30500
30501@vindex calc-embedded-open-formula 30501@vindex calc-embedded-open-formula
@@ -30584,7 +30584,7 @@ The default string is @code{"%%% "} (note the trailing space).
30584@vindex calc-embedded-close-plain 30584@vindex calc-embedded-close-plain
30585The @code{calc-embedded-close-plain} variable is a string which 30585The @code{calc-embedded-close-plain} variable is a string which
30586ends a ``plain'' formula. The default is @code{" %%%\n"}. Without 30586ends a ``plain'' formula. The default is @code{" %%%\n"}. Without
30587the trailing newline here, the first line of a ``big'' mode formula 30587the trailing newline here, the first line of a Big mode formula
30588that followed might be shifted over with respect to the other lines. 30588that followed might be shifted over with respect to the other lines.
30589 30589
30590@vindex calc-embedded-open-new-formula 30590@vindex calc-embedded-open-new-formula
@@ -31045,7 +31045,7 @@ conditional and looping commands.
31045@cindex Restoring saved modes 31045@cindex Restoring saved modes
31046Keyboard macros sometimes want to operate under known conditions 31046Keyboard macros sometimes want to operate under known conditions
31047without affecting surrounding conditions. For example, a keyboard 31047without affecting surrounding conditions. For example, a keyboard
31048macro may wish to turn on Fraction Mode, or set a particular 31048macro may wish to turn on Fraction mode, or set a particular
31049precision, independent of the user's normal setting for those 31049precision, independent of the user's normal setting for those
31050modes. 31050modes.
31051 31051
@@ -31094,7 +31094,7 @@ for all mode-setting commands inside the macro.
31094In fact, @kbd{C-u Z `} is like @kbd{Z `} except that it sets the modes 31094In fact, @kbd{C-u Z `} is like @kbd{Z `} except that it sets the modes
31095listed above to their default values. As usual, the matching @kbd{Z '} 31095listed above to their default values. As usual, the matching @kbd{Z '}
31096will restore the modes to their settings from before the @kbd{C-u Z `}. 31096will restore the modes to their settings from before the @kbd{C-u Z `}.
31097Also, @w{@kbd{Z `}} with a negative prefix argument resets algebraic mode 31097Also, @w{@kbd{Z `}} with a negative prefix argument resets the algebraic mode
31098to its default (off) but leaves the other modes the same as they were 31098to its default (off) but leaves the other modes the same as they were
31099outside the construct. 31099outside the construct.
31100 31100
@@ -32166,7 +32166,7 @@ If the first argument to @code{calc-eval} is a list whose first
32166element is a formula string, then @code{calc-eval} sets all the 32166element is a formula string, then @code{calc-eval} sets all the
32167various Calc modes to their default values while the formula is 32167various Calc modes to their default values while the formula is
32168evaluated and formatted. For example, the precision is set to 12 32168evaluated and formatted. For example, the precision is set to 12
32169digits, digit grouping is turned off, and the normal language 32169digits, digit grouping is turned off, and the Normal language
32170mode is used. 32170mode is used.
32171 32171
32172This same principle applies to the other options discussed below. 32172This same principle applies to the other options discussed below.
@@ -32189,7 +32189,7 @@ It's usually best to use this form of @code{calc-eval} unless your
32189program actually considers the interaction with Calc's mode settings 32189program actually considers the interaction with Calc's mode settings
32190to be a feature. This will avoid all sorts of potential ``gotchas''; 32190to be a feature. This will avoid all sorts of potential ``gotchas'';
32191consider what happens with @samp{(calc-eval "sqrt(2)" 'num)} 32191consider what happens with @samp{(calc-eval "sqrt(2)" 'num)}
32192when the user has left Calc in symbolic mode or no-simplify mode. 32192when the user has left Calc in Symbolic mode or No-Simplify mode.
32193 32193
32194As another example, @samp{(equal (calc-eval '("$<$$") nil a b) "1")} 32194As another example, @samp{(equal (calc-eval '("$<$$") nil a b) "1")}
32195checks if the number in string @expr{a} is less than the one in 32195checks if the number in string @expr{a} is less than the one in
@@ -32765,7 +32765,7 @@ will be used.
32765This function takes a Calc object and ``normalizes'' it. At the very 32765This function takes a Calc object and ``normalizes'' it. At the very
32766least this involves re-rounding floating-point values according to the 32766least this involves re-rounding floating-point values according to the
32767current precision and other similar jobs. Also, unless the user has 32767current precision and other similar jobs. Also, unless the user has
32768selected no-simplify mode (@pxref{Simplification Modes}), this involves 32768selected No-Simplify mode (@pxref{Simplification Modes}), this involves
32769actually evaluating a formula object by executing the function calls 32769actually evaluating a formula object by executing the function calls
32770it contains, and possibly also doing algebraic simplification, etc. 32770it contains, and possibly also doing algebraic simplification, etc.
32771@end defun 32771@end defun
@@ -33127,13 +33127,13 @@ function call which led here will be left in symbolic form.
33127@end defun 33127@end defun
33128 33128
33129@defun inexact-value 33129@defun inexact-value
33130If Symbolic Mode is enabled, this will signal an error that causes 33130If Symbolic mode is enabled, this will signal an error that causes
33131@code{normalize} to leave the formula in symbolic form, with the message 33131@code{normalize} to leave the formula in symbolic form, with the message
33132``Inexact result.'' (This function has no effect when not in Symbolic Mode.) 33132``Inexact result.'' (This function has no effect when not in Symbolic mode.)
33133Note that if your function calls @samp{(sin 5)} in Symbolic Mode, the 33133Note that if your function calls @samp{(sin 5)} in Symbolic mode, the
33134@code{sin} function will call @code{inexact-value}, which will cause your 33134@code{sin} function will call @code{inexact-value}, which will cause your
33135function to be left unsimplified. You may instead wish to call 33135function to be left unsimplified. You may instead wish to call
33136@samp{(normalize (list 'calcFunc-sin 5))}, which in Symbolic Mode will 33136@samp{(normalize (list 'calcFunc-sin 5))}, which in Symbolic mode will
33137return the formula @samp{sin(5)} to your function. 33137return the formula @samp{sin(5)} to your function.
33138@end defun 33138@end defun
33139 33139
@@ -33179,9 +33179,9 @@ number of parameters, or because it returns @code{nil} or calls
33179@code{reject-arg} or @code{inexact-result}, @code{normalize} returns 33179@code{reject-arg} or @code{inexact-result}, @code{normalize} returns
33180the formula still in symbolic form. 33180the formula still in symbolic form.
33181 33181
33182If the current Simplification Mode is ``none'' or ``numeric arguments 33182If the current simplification mode is ``none'' or ``numeric arguments
33183only,'' @code{normalize} will act appropriately. However, the more 33183only,'' @code{normalize} will act appropriately. However, the more
33184powerful simplification modes (like algebraic simplification) are 33184powerful simplification modes (like Algebraic Simplification) are
33185not handled by @code{normalize}. They are handled by @code{calc-normalize}, 33185not handled by @code{normalize}. They are handled by @code{calc-normalize},
33186which calls @code{normalize} and possibly some other routines, such 33186which calls @code{normalize} and possibly some other routines, such
33187as @code{simplify} or @code{simplify-units}. Programs generally will 33187as @code{simplify} or @code{simplify-units}. Programs generally will
@@ -33369,7 +33369,7 @@ again to 30 digits for use in the present request.
33369If the current angular mode is Degrees or HMS, this function returns the 33369If the current angular mode is Degrees or HMS, this function returns the
33370integer 360. In Radians mode, this function returns either the 33370integer 360. In Radians mode, this function returns either the
33371corresponding value in radians to the current precision, or the formula 33371corresponding value in radians to the current precision, or the formula
33372@samp{2*pi}, depending on the Symbolic Mode. There are also similar 33372@samp{2*pi}, depending on the Symbolic mode. There are also similar
33373function @code{half-circle} and @code{quarter-circle}. 33373function @code{half-circle} and @code{quarter-circle}.
33374@end defun 33374@end defun
33375 33375
@@ -33427,12 +33427,12 @@ If @var{a} is a formula, this returns the formula @samp{deg(@var{a})}.
33427@end defun 33427@end defun
33428 33428
33429@defun to-radians-2 a 33429@defun to-radians-2 a
33430Like @code{to-radians}, except that in Symbolic Mode a degrees to 33430Like @code{to-radians}, except that in Symbolic mode a degrees to
33431radians conversion yields a formula like @samp{@var{a}*pi/180}. 33431radians conversion yields a formula like @samp{@var{a}*pi/180}.
33432@end defun 33432@end defun
33433 33433
33434@defun from-radians-2 a 33434@defun from-radians-2 a
33435Like @code{from-radians}, except that in Symbolic Mode a radians to 33435Like @code{from-radians}, except that in Symbolic mode a radians to
33436degrees conversion yields a formula like @samp{@var{a}*180/pi}. 33436degrees conversion yields a formula like @samp{@var{a}*180/pi}.
33437@end defun 33437@end defun
33438 33438