aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorKenichi Handa2012-11-23 23:36:24 +0900
committerKenichi Handa2012-11-23 23:36:24 +0900
commit2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9 (patch)
tree3711b97807201b7eeaa066003b1c3a4ce929e5bb /doc/misc
parente1d276cbf9e18f13101328f56bed1a1c0a66e63a (diff)
parente7d0e5ee247a155a268ffbf80bedbe25e15b5032 (diff)
downloademacs-2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9.tar.gz
emacs-2aaec2d9be5cec44ea3b59cba476fd3e091f2fc9.zip
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/ChangeLog16
-rw-r--r--doc/misc/calc.texi171
2 files changed, 114 insertions, 73 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 39931f3a779..6be52213a4a 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,7 +1,19 @@
12012-11-22 Paul Eggert <eggert@cs.ucla.edu>
2
3 * calc.texi: Fix TeX issues with capitals followed by ".", "?", "!".
4 (Date Forms): Correct off-by-one error in explanation of
5 Julian day numbers. Give Gregorian equivalent of its origin.
6
72012-11-22 Jay Belanger <jay.p.belanger@gmail.com>
8
9 * doc/misc/calc.texi (Date Forms): Mention the customizable
10 Gregorian-Julian switch.
11 (Customizing Calc): Mention the variable `calc-gregorian-switch'.
12
12012-11-17 Paul Eggert <eggert@cs.ucla.edu> 132012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2 14
3 Calc now uses the Gregorian calendar for all dates, 15 Calc now uses the Gregorian calendar for all dates (Bug#12633).
4 and uses January 1, 1 AD as its day number 1. 16 It also uses January 1, 1 AD as its day number 1.
5 * calc.texi (Date Forms): Document this. 17 * calc.texi (Date Forms): Document this.
6 18
72012-11-16 Glenn Morris <rgm@gnu.org> 192012-11-16 Glenn Morris <rgm@gnu.org>
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index 6daceb4d41a..0ce1efbff58 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -1186,7 +1186,7 @@ since the large integer arithmetic was there anyway it seemed only
1186fair to give the user direct access to it, which in turn made it 1186fair to give the user direct access to it, which in turn made it
1187practical to support fractions as well as floats. All these features 1187practical to support fractions as well as floats. All these features
1188inspired me to look around for other data types that might be worth 1188inspired me to look around for other data types that might be worth
1189having. 1189having.
1190 1190
1191Around this time, my friend Rick Koshi showed me his nifty new HP-28 1191Around this time, my friend Rick Koshi showed me his nifty new HP-28
1192calculator. It allowed the user to manipulate formulas as well as 1192calculator. It allowed the user to manipulate formulas as well as
@@ -4461,7 +4461,7 @@ date by one or several months. @xref{Date Arithmetic}, for more.
4461Friday the 13th? @xref{Types Answer 5, 5}. (@bullet{}) 4461Friday the 13th? @xref{Types Answer 5, 5}. (@bullet{})
4462 4462
4463(@bullet{}) @strong{Exercise 6.} How many leap years will there be 4463(@bullet{}) @strong{Exercise 6.} How many leap years will there be
4464between now and the year 10001 A.D.? @xref{Types Answer 6, 6}. (@bullet{}) 4464between now and the year 10001 AD@? @xref{Types Answer 6, 6}. (@bullet{})
4465 4465
4466@cindex Slope and angle of a line 4466@cindex Slope and angle of a line
4467@cindex Angle and slope of a line 4467@cindex Angle and slope of a line
@@ -5693,7 +5693,7 @@ on the stack, we want to be able to type @kbd{*} and get the result
5693rearranged. (This one is rather tricky; the solution at the end of 5693rearranged. (This one is rather tricky; the solution at the end of
5694this chapter uses 6 rewrite rules. Hint: The @samp{constant(x)} 5694this chapter uses 6 rewrite rules. Hint: The @samp{constant(x)}
5695condition tests whether @samp{x} is a number.) @xref{Rewrites Answer 5695condition tests whether @samp{x} is a number.) @xref{Rewrites Answer
56966, 6}. (@bullet{}) 56966, 6}. (@bullet{})
5697 5697
5698Just for kicks, try adding the rule @code{2+3 := 6} to @code{EvalRules}. 5698Just for kicks, try adding the rule @code{2+3 := 6} to @code{EvalRules}.
5699What happens? (Be sure to remove this rule afterward, or you might get 5699What happens? (Be sure to remove this rule afterward, or you might get
@@ -8697,7 +8697,7 @@ Multiplying by the conjugate helps because @expr{(a+b) (a-b) = a^2 - b^2}.
8697@smallexample 8697@smallexample
8698@group 8698@group
8699 ___ 8699 ___
87001: V 2 87001: V 2
8701 . 8701 .
8702 8702
8703 a r a*(b+c) := a*b + a*c 8703 a r a*(b+c) := a*b + a*c
@@ -8897,7 +8897,7 @@ Note that this rule does not mention @samp{O} at all, so it will
8897apply to any product-of-sum it encounters---this rule may surprise 8897apply to any product-of-sum it encounters---this rule may surprise
8898you if you put it into @code{EvalRules}! 8898you if you put it into @code{EvalRules}!
8899 8899
8900In the second rule, the sum of two O's is changed to the smaller O. 8900In the second rule, the sum of two O's is changed to the smaller O@.
8901The optional constant coefficients are there mostly so that 8901The optional constant coefficients are there mostly so that
8902@samp{O(x^2) - O(x^3)} and @samp{O(x^3) - O(x^2)} are handled 8902@samp{O(x^2) - O(x^3)} and @samp{O(x^3) - O(x^2)} are handled
8903as well as @samp{O(x^2) + O(x^3)}. 8903as well as @samp{O(x^2) + O(x^3)}.
@@ -10987,10 +10987,10 @@ Input is flexible; date forms can be entered in any of the usual
10987notations for dates and times. @xref{Date Formats}. 10987notations for dates and times. @xref{Date Formats}.
10988 10988
10989Date forms are stored internally as numbers, specifically the number 10989Date forms are stored internally as numbers, specifically the number
10990of days since midnight on the morning of January 1 of the year 1 AD. 10990of days since midnight on the morning of December 31 of the year 1 BC@.
10991If the internal number is an integer, the form represents a date only; 10991If the internal number is an integer, the form represents a date only;
10992if the internal number is a fraction or float, the form represents 10992if the internal number is a fraction or float, the form represents
10993a date and time. For example, @samp{<6:00am Wed Jan 9, 1991>} 10993a date and time. For example, @samp{<6:00am Thu Jan 10, 1991>}
10994is represented by the number 726842.25. The standard precision of 10994is represented by the number 726842.25. The standard precision of
1099512 decimal digits is enough to ensure that a (reasonable) date and 1099512 decimal digits is enough to ensure that a (reasonable) date and
10996time can be stored without roundoff error. 10996time can be stored without roundoff error.
@@ -11010,55 +11010,70 @@ You can use the @kbd{v p} (@code{calc-pack}) and @kbd{v u}
11010of a date form. @xref{Packing and Unpacking}. 11010of a date form. @xref{Packing and Unpacking}.
11011 11011
11012Date forms can go arbitrarily far into the future or past. Negative 11012Date forms can go arbitrarily far into the future or past. Negative
11013year numbers represent years BC. There is no ``year 0''; the day 11013year numbers represent years BC@. There is no ``year 0''; the day
11014before @samp{<Mon Jan 1, +1>} is @samp{<Sun Dec 31, -1>}. These are 11014before @samp{<Mon Jan 1, +1>} is @samp{<Sun Dec 31, -1>}. These are
11015days 1 and 0 respectively in Calc's internal numbering scheme. The 11015days 1 and 0 respectively in Calc's internal numbering scheme. The
11016Gregorian calendar is used for all dates, including dates before the 11016Gregorian calendar is used for all dates, including dates before the
11017Gregorian calendar was invented. Thus Calc's use of the day number 11017Gregorian calendar was invented (although that can be configured; see
11018@mathit{-10000} to represent August 15, 28 BC should be taken with a 11018below). Thus Calc's use of the day number @mathit{-10000} to
11019grain of salt. 11019represent August 15, 28 BC should be taken with a grain of salt.
11020 11020
11021@cindex Julian calendar 11021@cindex Julian calendar
11022@cindex Gregorian calendar 11022@cindex Gregorian calendar
11023Some historical background: The Julian calendar was created by 11023Some historical background: The Julian calendar was created by
11024Julius Caesar in the year 46 BC as an attempt to fix the confusion 11024Julius Caesar in the year 46 BC as an attempt to fix the confusion
11025caused by the irregular Roman calendar that was used before that time. 11025caused by the irregular Roman calendar that was used before that time.
11026The Julian calendar introduced an extra day in 11026The Julian calendar introduced an extra day in all years divisible by
11027all years divisible by four. After some initial confusion, the 11027four. After some initial confusion, the calendar was adopted around
11028calendar was adopted around the year we call 8 AD, although the years were 11028the year we call 8 AD@. Some centuries later it became
11029numbered differently and did not necessarily begin on January 1. Some centuries 11029apparent that the Julian year of 365.25 days was itself not quite
11030later it became apparent that the Julian year of 365.25 days was 11030right. In 1582 Pope Gregory XIII introduced the Gregorian calendar,
11031itself not quite right. In 1582 Pope Gregory XIII introduced the 11031which added the new rule that years divisible by 100, but not by 400,
11032Gregorian calendar, which added the new rule that years divisible 11032were not to be considered leap years despite being divisible by four.
11033by 100, but not by 400, were not to be considered leap years 11033Many countries delayed adoption of the Gregorian calendar
11034despite being divisible by four. Many countries delayed adoption 11034because of religious differences. For example, Great Britain and the
11035of the Gregorian calendar because of religious differences, and 11035British colonies switched to the Gregorian calendar in September
11036used differing year numbers and start-of-year for other reasons; 110361752, when the Julian calendar was eleven days behind the
11037for example, in early 1752 England changed the start of its year from 11037Gregorian calendar. That year in Britain, the day after September 2
11038March 25 to January 1, and in September it switched to the Gregorian 11038was September 14. To take another example, Russia did not adopt the
11039calendar: in England, the day after December 31, 1750 was January 1, 11039Gregorian calendar until 1918, and that year in Russia the day after
110401750 and the day after March 24, 1750 was March 25, 1751, but the day 11040January 31 was February 14. Calc's reckoning therefore matches English
11041after December 31, 1751 was January 1, 1752 and the day after 11041practice starting in 1752 and Russian practice starting in 1918, but
11042September 2, 1752 was September 14, 1752. To take another example, 11042disagrees with earlier dates in both countries.
11043Russia switched both year numbering and start-of-year in 1700, but did 11043
11044not adopt the Gregorian calendar until 1918. Calc's reckoning 11044When the Julian calendar was introduced, it had January 1 as the first
11045therefore matches English practice starting in 1752 and Russian 11045day of the year. By the Middle Ages, many European countries
11046practice starting in 1918, but disagrees with earlier dates in both 11046had changed the beginning of a new year to a different date, often to
11047countries. 11047a religious festival. Almost all countries reverted to using January 1
11048 11048as the beginning of the year by the time they adopted the Gregorian
11049Today's timekeepers introduce an occasional ``leap second'' as 11049calendar.
11050well, but Calc does not take these minor effects into account. 11050
11051(If it did, it would have to report a non-integer number of days 11051Some calendars attempt to mimic the historical situation by using the
11052between, say, @samp{<12:00am Mon Jan 1, 1900>} and 11052Gregorian calendar for recent dates and the Julian calendar for older
11053dates. The @code{cal} program in most Unix implementations does this,
11054for example. While January 1 wasn't always the beginning of a calendar
11055year, these hybrid calendars still use January 1 as the beginning of
11056the year even for older dates. The customizable variable
11057@code{calc-gregorian-switch} (@pxref{Customizing Calc}) can be set to
11058have Calc's date forms switch from the Julian to Gregorian calendar at
11059any specified date.
11060
11061Today's timekeepers introduce an occasional ``leap second''.
11062These do not occur regularly and Calc does not take these minor
11063effects into account. (If it did, it would have to report a
11064non-integer number of days between, say,
11065@samp{<12:00am Mon Jan 1, 1900>} and
11053@samp{<12:00am Sat Jan 1, 2000>}.) 11066@samp{<12:00am Sat Jan 1, 2000>}.)
11054 11067
11055@cindex Julian day counting 11068@cindex Julian day counting
11056Another day counting system in common use is, confusingly, also called 11069Another day counting system in common use is, confusingly, also called
11057``Julian.'' The Julian day number is the numbers of days since 11070``Julian.'' Julian days go from noon to noon. The Julian day number
1105812:00 noon (GMT) on Jan 1, 4713 BC, which in Calc's scheme (in GMT) 11071is the numbers of days since 12:00 noon (GMT) on November 24, 4714 BC
11059is @mathit{-1721423.5} (recall that Calc starts at midnight instead 11072in the Gregorian calendar (i.e., January 1, 4713 BC in the Julian
11060of noon). Thus to convert a Calc date code obtained by unpacking a 11073calendar). In Calc's scheme (in GMT) the Julian day origin is
11061date form into a Julian day number, simply add 1721423.5 after 11074@mathit{-1721422.5}, because Calc starts at midnight instead of noon.
11075Thus to convert a Calc date code obtained by unpacking a
11076date form into a Julian day number, simply add 1721422.5 after
11062compensating for the time zone difference. The built-in @kbd{t J} 11077compensating for the time zone difference. The built-in @kbd{t J}
11063command performs this conversion for you. 11078command performs this conversion for you.
11064 11079
@@ -11090,7 +11105,7 @@ the Julian cycle as an astronomical dating system; this idea was taken
11090up by other astronomers. (At the time, noon was the start of the 11105up by other astronomers. (At the time, noon was the start of the
11091astronomical day. Herschel originally suggested counting the days 11106astronomical day. Herschel originally suggested counting the days
11092since Jan 1, 4713 BC at noon Alexandria time; this was later amended to 11107since Jan 1, 4713 BC at noon Alexandria time; this was later amended to
11093noon GMT.) Julian day numbering is largely used in astronomy. 11108noon GMT@.) Julian day numbering is largely used in astronomy.
11094 11109
11095@cindex Unix time format 11110@cindex Unix time format
11096The Unix operating system measures time as an integer number of 11111The Unix operating system measures time as an integer number of
@@ -12638,7 +12653,7 @@ are simplified with their unit definitions in mind.
12638A common technique is to set the simplification mode down to the lowest 12653A common technique is to set the simplification mode down to the lowest
12639amount of simplification you will allow to be applied automatically, then 12654amount of simplification you will allow to be applied automatically, then
12640use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to 12655use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to
12641perform higher types of simplifications on demand. 12656perform higher types of simplifications on demand.
12642@node Declarations, Display Modes, Simplification Modes, Mode Settings 12657@node Declarations, Display Modes, Simplification Modes, Mode Settings
12643@section Declarations 12658@section Declarations
12644 12659
@@ -12989,7 +13004,7 @@ The @code{dneg} function checks for negative reals. The @code{dnonneg}
12989function checks for nonnegative reals, i.e., reals greater than or 13004function checks for nonnegative reals, i.e., reals greater than or
12990equal to zero. Note that Calc's algebraic simplifications, which are 13005equal to zero. Note that Calc's algebraic simplifications, which are
12991effectively applied to all conditions in rewrite rules, can simplify 13006effectively applied to all conditions in rewrite rules, can simplify
12992an expression like @expr{x > 0} to 1 or 0 using @code{dpos}. 13007an expression like @expr{x > 0} to 1 or 0 using @code{dpos}.
12993So the actual functions @code{dpos}, @code{dneg}, and @code{dnonneg} 13008So the actual functions @code{dpos}, @code{dneg}, and @code{dnonneg}
12994are rarely necessary. 13009are rarely necessary.
12995 13010
@@ -13424,7 +13439,7 @@ the time part. The punctuation characters (including spaces) must
13424match exactly; letter fields must correspond to suitable text in 13439match exactly; letter fields must correspond to suitable text in
13425the input. If this doesn't work, Calc checks if the input is a 13440the input. If this doesn't work, Calc checks if the input is a
13426simple number; if so, the number is interpreted as a number of days 13441simple number; if so, the number is interpreted as a number of days
13427since Jan 1, 1 AD. Otherwise, Calc tries a much more relaxed and 13442since Jan 1, 1 AD@. Otherwise, Calc tries a much more relaxed and
13428flexible algorithm which is described in the next section. 13443flexible algorithm which is described in the next section.
13429 13444
13430Weekday names are ignored during reading. 13445Weekday names are ignored during reading.
@@ -14653,7 +14668,7 @@ Subscripts use double square brackets: @samp{a[[i]]}.
14653The @kbd{d W} (@code{calc-maple-language}) command selects the 14668The @kbd{d W} (@code{calc-maple-language}) command selects the
14654conventions of Maple. 14669conventions of Maple.
14655 14670
14656Maple's language is much like C. Underscores are allowed in symbol 14671Maple's language is much like C@. Underscores are allowed in symbol
14657names; square brackets are used for subscripts; explicit @samp{*}s for 14672names; square brackets are used for subscripts; explicit @samp{*}s for
14658multiplications are required. Use either @samp{^} or @samp{**} to 14673multiplications are required. Use either @samp{^} or @samp{**} to
14659denote powers. 14674denote powers.
@@ -16714,7 +16729,7 @@ number (i.e., pervasively).
16714If the simplification mode is set below basic simplification, it is raised 16729If the simplification mode is set below basic simplification, it is raised
16715for the purposes of this command. Thus, @kbd{c c} applies the basic 16730for the purposes of this command. Thus, @kbd{c c} applies the basic
16716simplifications even if their automatic application is disabled. 16731simplifications even if their automatic application is disabled.
16717@xref{Simplification Modes}. 16732@xref{Simplification Modes}.
16718 16733
16719@cindex Roundoff errors, correcting 16734@cindex Roundoff errors, correcting
16720A numeric prefix argument to @kbd{c c} sets the floating-point precision 16735A numeric prefix argument to @kbd{c c} sets the floating-point precision
@@ -16791,7 +16806,7 @@ additional argument from the top of the stack.
16791@pindex calc-date 16806@pindex calc-date
16792@tindex date 16807@tindex date
16793The @kbd{t D} (@code{calc-date}) [@code{date}] command converts a 16808The @kbd{t D} (@code{calc-date}) [@code{date}] command converts a
16794date form into a number, measured in days since Jan 1, 1 AD. The 16809date form into a number, measured in days since Jan 1, 1 AD@. The
16795result will be an integer if @var{date} is a pure date form, or a 16810result will be an integer if @var{date} is a pure date form, or a
16796fraction or float if @var{date} is a date/time form. Or, if its 16811fraction or float if @var{date} is a date/time form. Or, if its
16797argument is a number, it converts this number into a date form. 16812argument is a number, it converts this number into a date form.
@@ -16829,7 +16844,7 @@ The last two arguments default to zero if omitted.
16829@cindex Julian day counts, conversions 16844@cindex Julian day counts, conversions
16830The @kbd{t J} (@code{calc-julian}) [@code{julian}] command converts 16845The @kbd{t J} (@code{calc-julian}) [@code{julian}] command converts
16831a date form into a Julian day count, which is the number of days 16846a date form into a Julian day count, which is the number of days
16832since noon (GMT) on Jan 1, 4713 BC. A pure date is converted to an 16847since noon (GMT) on Jan 1, 4713 BC@. A pure date is converted to an
16833integer Julian count representing noon of that day. A date/time form 16848integer Julian count representing noon of that day. A date/time form
16834is converted to an exact floating-point Julian count, adjusted to 16849is converted to an exact floating-point Julian count, adjusted to
16835interpret the date form in the current time zone but the Julian 16850interpret the date form in the current time zone but the Julian
@@ -18975,7 +18990,7 @@ modulo operation as numbers 39 and below.) If @var{m} is a power of
18975ten, however, the numbers should be completely unbiased. 18990ten, however, the numbers should be completely unbiased.
18976 18991
18977The Gaussian random numbers generated by @samp{random(0.0)} use the 18992The Gaussian random numbers generated by @samp{random(0.0)} use the
18978``polar'' method described in Knuth section 3.4.1C. This method 18993``polar'' method described in Knuth section 3.4.1C@. This method
18979generates a pair of Gaussian random numbers at a time, so only every 18994generates a pair of Gaussian random numbers at a time, so only every
18980other call to @samp{random(0.0)} will require significant calculations. 18995other call to @samp{random(0.0)} will require significant calculations.
18981 18996
@@ -22175,7 +22190,7 @@ Use @kbd{a v} if you want the variables to ignore their stored values.
22175If you give a numeric prefix argument of 2 to @kbd{a v}, it simplifies 22190If you give a numeric prefix argument of 2 to @kbd{a v}, it simplifies
22176using Calc's algebraic simplifications; @pxref{Simplifying Formulas}. 22191using Calc's algebraic simplifications; @pxref{Simplifying Formulas}.
22177If you give a numeric prefix of 3 or more, it uses Extended 22192If you give a numeric prefix of 3 or more, it uses Extended
22178Simplification mode (@kbd{a e}). 22193Simplification mode (@kbd{a e}).
22179 22194
22180If you give a negative prefix argument @mathit{-1}, @mathit{-2}, or @mathit{-3}, 22195If you give a negative prefix argument @mathit{-1}, @mathit{-2}, or @mathit{-3},
22181it simplifies in the corresponding mode but only works on the top-level 22196it simplifies in the corresponding mode but only works on the top-level
@@ -22248,7 +22263,7 @@ If inequalities with opposite direction (e.g., @samp{<} and @samp{>})
22248are mapped, the direction of the second inequality is reversed to 22263are mapped, the direction of the second inequality is reversed to
22249match the first: Using @kbd{a M +} on @samp{a < b} and @samp{a > 2} 22264match the first: Using @kbd{a M +} on @samp{a < b} and @samp{a > 2}
22250reverses the latter to get @samp{2 < a}, which then allows the 22265reverses the latter to get @samp{2 < a}, which then allows the
22251combination @samp{a + 2 < b + a}, which the algebraic simplifications 22266combination @samp{a + 2 < b + a}, which the algebraic simplifications
22252can reduce to @samp{2 < b}. 22267can reduce to @samp{2 < b}.
22253 22268
22254Using @kbd{a M *}, @kbd{a M /}, @kbd{a M n}, or @kbd{a M &} to negate 22269Using @kbd{a M *}, @kbd{a M /}, @kbd{a M n}, or @kbd{a M &} to negate
@@ -22395,7 +22410,7 @@ common special case of regular arithmetic commands like @kbd{+} and
22395@kbd{Q} [@code{sqrt}], the arguments are simply popped from the stack 22410@kbd{Q} [@code{sqrt}], the arguments are simply popped from the stack
22396and collected into a suitable function call, which is then simplified 22411and collected into a suitable function call, which is then simplified
22397(the arguments being simplified first as part of the process, as 22412(the arguments being simplified first as part of the process, as
22398described above). 22413described above).
22399 22414
22400Even the basic set of simplifications are too numerous to describe 22415Even the basic set of simplifications are too numerous to describe
22401completely here, but this section will describe the ones that apply to the 22416completely here, but this section will describe the ones that apply to the
@@ -22701,7 +22716,7 @@ the algebraic simplification mode, which is the default simplification
22701mode. If you have switched to a different simplification mode, you can 22716mode. If you have switched to a different simplification mode, you can
22702switch back with the @kbd{m A} command. Even in other simplification 22717switch back with the @kbd{m A} command. Even in other simplification
22703modes, the @kbd{a s} command will use these algebraic simplifications to 22718modes, the @kbd{a s} command will use these algebraic simplifications to
22704simplify the formula. 22719simplify the formula.
22705 22720
22706There is a variable, @code{AlgSimpRules}, in which you can put rewrites 22721There is a variable, @code{AlgSimpRules}, in which you can put rewrites
22707to be applied. Its use is analogous to @code{EvalRules}, 22722to be applied. Its use is analogous to @code{EvalRules},
@@ -22738,7 +22753,7 @@ This allows easier comparison of products; for example, the basic
22738simplifications will not change @expr{x y + y x} to @expr{2 x y}, 22753simplifications will not change @expr{x y + y x} to @expr{2 x y},
22739but the algebraic simplifications; it first rewrites the sum to 22754but the algebraic simplifications; it first rewrites the sum to
22740@expr{x y + x y} which can then be recognized as a sum of identical 22755@expr{x y + x y} which can then be recognized as a sum of identical
22741terms. 22756terms.
22742 22757
22743The canonical ordering used to sort terms of products has the 22758The canonical ordering used to sort terms of products has the
22744property that real-valued numbers, interval forms and infinities 22759property that real-valued numbers, interval forms and infinities
@@ -22781,10 +22796,10 @@ factor in the numerator and denominator, it is canceled out;
22781for example, @expr{(4 x + 6) / 8 x} simplifies to @expr{(2 x + 3) / 4 x}. 22796for example, @expr{(4 x + 6) / 8 x} simplifies to @expr{(2 x + 3) / 4 x}.
22782 22797
22783Non-constant common factors are not found even by algebraic 22798Non-constant common factors are not found even by algebraic
22784simplifications. To cancel the factor @expr{a} in 22799simplifications. To cancel the factor @expr{a} in
22785@expr{(a x + a) / a^2} you could first use @kbd{j M} on the product 22800@expr{(a x + a) / a^2} you could first use @kbd{j M} on the product
22786@expr{a x} to Merge the numerator to @expr{a (1+x)}, which can then be 22801@expr{a x} to Merge the numerator to @expr{a (1+x)}, which can then be
22787simplified successfully. 22802simplified successfully.
22788 22803
22789@tex 22804@tex
22790\bigskip 22805\bigskip
@@ -22937,7 +22952,7 @@ as is @expr{x^2 >= 0} if @expr{x} is known to be real.
22937@tindex esimplify 22952@tindex esimplify
22938Calc is capable of performing some simplifications which may sometimes 22953Calc is capable of performing some simplifications which may sometimes
22939be desired but which are not ``safe'' in all cases. The @kbd{a e} 22954be desired but which are not ``safe'' in all cases. The @kbd{a e}
22940(@code{calc-simplify-extended}) [@code{esimplify}] command 22955(@code{calc-simplify-extended}) [@code{esimplify}] command
22941applies the algebraic simplifications as well as these extended, or 22956applies the algebraic simplifications as well as these extended, or
22942``unsafe'', simplifications. Use this only if you know the values in 22957``unsafe'', simplifications. Use this only if you know the values in
22943your formula lie in the restricted ranges for which these 22958your formula lie in the restricted ranges for which these
@@ -23581,10 +23596,10 @@ forever!)
23581@vindex IntegSimpRules 23596@vindex IntegSimpRules
23582Another set of rules, stored in @code{IntegSimpRules}, are applied 23597Another set of rules, stored in @code{IntegSimpRules}, are applied
23583every time the integrator uses algebraic simplifications to simplify an 23598every time the integrator uses algebraic simplifications to simplify an
23584intermediate result. For example, putting the rule 23599intermediate result. For example, putting the rule
23585@samp{twice(x) := 2 x} into @code{IntegSimpRules} would tell Calc to 23600@samp{twice(x) := 2 x} into @code{IntegSimpRules} would tell Calc to
23586convert the @code{twice} function into a form it knows whenever 23601convert the @code{twice} function into a form it knows whenever
23587integration is attempted. 23602integration is attempted.
23588 23603
23589One more way to influence the integrator is to define a function with 23604One more way to influence the integrator is to define a function with
23590the @kbd{Z F} command (@pxref{Algebraic Definitions}). Calc's 23605the @kbd{Z F} command (@pxref{Algebraic Definitions}). Calc's
@@ -26749,7 +26764,7 @@ meta-variable @expr{v}. As usual, if this meta-variable has already
26749been matched to something else the two values must be equal; if the 26764been matched to something else the two values must be equal; if the
26750meta-variable is new then it is bound to the result of the expression. 26765meta-variable is new then it is bound to the result of the expression.
26751This variable can then appear in later conditions, and on the righthand 26766This variable can then appear in later conditions, and on the righthand
26752side of the rule. 26767side of the rule.
26753In fact, @expr{v} may be any pattern in which case the result of 26768In fact, @expr{v} may be any pattern in which case the result of
26754evaluating @expr{x} is matched to that pattern, binding any 26769evaluating @expr{x} is matched to that pattern, binding any
26755meta-variables that appear in that pattern. Note that @code{let} 26770meta-variables that appear in that pattern. Note that @code{let}
@@ -27503,7 +27518,7 @@ but only when algebraic simplifications are used to simplify the
27503formula. The variable @code{AlgSimpRules} holds rules for this purpose. 27518formula. The variable @code{AlgSimpRules} holds rules for this purpose.
27504The @kbd{a s} command will apply @code{EvalRules} and 27519The @kbd{a s} command will apply @code{EvalRules} and
27505@code{AlgSimpRules} to the formula, as well as all of its built-in 27520@code{AlgSimpRules} to the formula, as well as all of its built-in
27506simplifications. 27521simplifications.
27507 27522
27508Most of the special limitations for @code{EvalRules} don't apply to 27523Most of the special limitations for @code{EvalRules} don't apply to
27509@code{AlgSimpRules}. Calc simply does an @kbd{a r AlgSimpRules} 27524@code{AlgSimpRules}. Calc simply does an @kbd{a r AlgSimpRules}
@@ -27511,7 +27526,7 @@ command with an infinite repeat count as the first step of algebraic
27511simplifications. It then applies its own built-in simplifications 27526simplifications. It then applies its own built-in simplifications
27512throughout the formula, and then repeats these two steps (along with 27527throughout the formula, and then repeats these two steps (along with
27513applying the default simplifications) until no further changes are 27528applying the default simplifications) until no further changes are
27514possible. 27529possible.
27515 27530
27516@cindex @code{ExtSimpRules} variable 27531@cindex @code{ExtSimpRules} variable
27517@cindex @code{UnitSimpRules} variable 27532@cindex @code{UnitSimpRules} variable
@@ -28946,9 +28961,9 @@ to select the lefthand side, execute your commands, then type
28946All current modes apply when an @samp{=>} operator is computed, 28961All current modes apply when an @samp{=>} operator is computed,
28947including the current simplification mode. Recall that the 28962including the current simplification mode. Recall that the
28948formula @samp{arcsin(sin(x))} will not be handled by Calc's algebraic 28963formula @samp{arcsin(sin(x))} will not be handled by Calc's algebraic
28949simplifications, but Calc's unsafe simplifications will reduce it to 28964simplifications, but Calc's unsafe simplifications will reduce it to
28950@samp{x}. If you enter @samp{arcsin(sin(x)) =>} normally, the result 28965@samp{x}. If you enter @samp{arcsin(sin(x)) =>} normally, the result
28951will be @samp{arcsin(sin(x)) => arcsin(sin(x))}. If you change to 28966will be @samp{arcsin(sin(x)) => arcsin(sin(x))}. If you change to
28952Extended Simplification mode, the result will be 28967Extended Simplification mode, the result will be
28953@samp{arcsin(sin(x)) => x}. However, just pressing @kbd{a e} 28968@samp{arcsin(sin(x)) => x}. However, just pressing @kbd{a e}
28954once will have no effect on @samp{arcsin(sin(x)) => arcsin(sin(x))}, 28969once will have no effect on @samp{arcsin(sin(x)) => arcsin(sin(x))},
@@ -29566,7 +29581,7 @@ plot on any text-only printer.
29566@kindex g O 29581@kindex g O
29567@pindex calc-graph-output 29582@pindex calc-graph-output
29568The @kbd{g O} (@code{calc-graph-output}) command sets the name of the 29583The @kbd{g O} (@code{calc-graph-output}) command sets the name of the
29569output file used by GNUPLOT. For some devices, notably @code{x11} and 29584output file used by GNUPLOT@. For some devices, notably @code{x11} and
29570@code{windows}, there is no output file and this information is not 29585@code{windows}, there is no output file and this information is not
29571used. Many other ``devices'' are really file formats like 29586used. Many other ``devices'' are really file formats like
29572@code{postscript}; in these cases the output in the desired format 29587@code{postscript}; in these cases the output in the desired format
@@ -29638,7 +29653,7 @@ window in the upper-left corner of the screen. This command has no
29638effect if the current device is @code{windows}. 29653effect if the current device is @code{windows}.
29639 29654
29640The buffer called @samp{*Gnuplot Trail*} holds a transcript of the 29655The buffer called @samp{*Gnuplot Trail*} holds a transcript of the
29641session with GNUPLOT. This shows the commands Calc has ``typed'' to 29656session with GNUPLOT@. This shows the commands Calc has ``typed'' to
29642GNUPLOT and the responses it has received. Calc tries to notice when an 29657GNUPLOT and the responses it has received. Calc tries to notice when an
29643error message has appeared here and display the buffer for you when 29658error message has appeared here and display the buffer for you when
29644this happens. You can check this buffer yourself if you suspect 29659this happens. You can check this buffer yourself if you suspect
@@ -33249,7 +33264,7 @@ in the range @samp{[0 ..@: 60)}.
33249 33264
33250Date forms are stored as @samp{(date @var{n})}, where @var{n} is 33265Date forms are stored as @samp{(date @var{n})}, where @var{n} is
33251a real number that counts days since midnight on the morning of 33266a real number that counts days since midnight on the morning of
33252January 1, 1 AD. If @var{n} is an integer, this is a pure date 33267January 1, 1 AD@. If @var{n} is an integer, this is a pure date
33253form. If @var{n} is a fraction or float, this is a date/time form. 33268form. If @var{n} is a fraction or float, this is a date/time form.
33254 33269
33255Modulo forms are stored as @samp{(mod @var{n} @var{m})}, where @var{m} is a 33270Modulo forms are stored as @samp{(mod @var{n} @var{m})}, where @var{m} is a
@@ -33757,7 +33772,7 @@ objects into a definite, consistent order. The @code{beforep}
33757function is used by the @kbd{V S} vector-sorting command, and also 33772function is used by the @kbd{V S} vector-sorting command, and also
33758by Calc's algebraic simplifications to put the terms of a product into 33773by Calc's algebraic simplifications to put the terms of a product into
33759canonical order: This allows @samp{x y + y x} to be simplified easily to 33774canonical order: This allows @samp{x y + y x} to be simplified easily to
33760@samp{2 x y}. 33775@samp{2 x y}.
33761@end defun 33776@end defun
33762 33777
33763@defun equal x y 33778@defun equal x y
@@ -35590,6 +35605,20 @@ number of undo steps that will be preserved; if
35590be preserved. The default value of @code{calc-undo-length} is @expr{100}. 35605be preserved. The default value of @code{calc-undo-length} is @expr{100}.
35591@end defvar 35606@end defvar
35592 35607
35608@defvar calc-gregorian-switch
35609See @ref{Date Forms}.@*
35610The variable @code{calc-gregorian-switch} is either a list of integers
35611@code{(@var{YEAR} @var{MONTH} @var{DAY})} or @code{nil}.
35612If it is @code{nil}, then Calc's date forms always represent Gregorian dates.
35613Otherwise, @code{calc-gregorian-switch} represents the date that the
35614calendar switches from Julian dates to Gregorian dates;
35615@code{(@var{YEAR} @var{MONTH} @var{DAY})} will be the first Gregorian
35616date. The customization buffer will offer several standard dates to
35617choose from, or the user can enter their own date.
35618
35619The default value of @code{calc-gregorian-switch} is @code{nil}.
35620@end defvar
35621
35593@node Reporting Bugs, Summary, Customizing Calc, Top 35622@node Reporting Bugs, Summary, Customizing Calc, Top
35594@appendix Reporting Bugs 35623@appendix Reporting Bugs
35595 35624