Home » CEEFAX disks » telesoftware15.adl » 08-04-89/JulianD
08-04-89/JulianD
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » CEEFAX disks » telesoftware15.adl |
Filename: | 08-04-89/JulianD |
Read OK: | ✔ |
File size: | 3B3C bytes |
Load address: | 0000 |
Exec address: | FFFFFFFF |
File contents
The following article is reproduced with permission from the May 1984 issue of Sky & Telescope magazine, and remains the copyright of the Sky Publishing Corporation. The "Sky & Telescope" magazine (ISSN 0037-6604) is published monthly by: Sky Publishing Corporation, 49, Bay State Road, Cambridge, Mass. 02238-1290 U.S.A. -----oOo----- Astronomical Computing Conducted by Roger W. Sinnott Taming Our Chaotic Calendar A routine for calendar conversion lies at the heart of many astronomical programs. Often we want a computer to calculate something for a particular date and time, or to tell us the day and month when an event will occur (an eclipse or occultation, perhaps). Digital watches often fail at date conversion, and last February 29th quite a few of them around the world probably indicated March 1st. To make our computer routines as universal as possible, let's lay down certain firm expectations for them. First of all, the machine should "resolve" intervals as small as 1 second of time (that is, about 0.00001 day). It takes only a little effort to build this accuracy into our calendar conversion routines so they won't need later revision for special programs. Second, let's avoid simple-looking procedures that only work between certain years (for example, A.D. 1901 to 2099). Sooner or later, we'll probably attempt a calculation outside this interval, little suspecting that the computer will misinterpret a date we've entered, usually by some whole number of days! To express an instant internally in the computer, we'll use Julian day numbers and fractions, as first applied to astronomical observations by John Herschel. The starting instant of this system (that is, day 0.0) corresponds to noon, Greenwich Mean Time, on January 1, 4713 B.C. - sufficiently far back in time that we should never have to worry about negative day numbers (and won't). At 0 hours Universal Time on any day, the decimal part of the Julian date is .5 exactly. Astronomical Computing Page 1 of 6 What about the changeover from the Julian calendar to the Gregorian? The Julian calendar (which has nothing to do with Julian Day numbers) had simpler leap-year rules and was in wide civil use before A.D. 1582. The switch to the Gregorian was delayed until 1752 in England and the American colonies, and as late as 1873 in Japan and 1927 in Turkey. A special flag in a program can ensure the computer is oriented to the proper calendar. Finally, it's important to distinguish A.D. and B.C. years somehow. The standard way to do this regards A.D. years as positive whole numbers; 1 B.C. is called the year 0, 2 B.C. is -1, 3 B.C. is -2, and so on. This helps keep leap years straight. Julius Caesar introduced his calendar reform in the year 45 B.C., which becomes -44 on our scheme. And since that was in fact leap year, the modern divide-by-four rule applies to negative as well as positive years. (Readers are warned that some recent books and articles have used the notation 1 B.C. = -1, and 2 B.C. = -2, a very confusing symbolism.) The Julian calendar did not really come into consistent civil use until after A.D. 8. But chronologers customarily extrapolate it backwards and call it the Julian proleptic calendar to distinguish it from the various civil calendars that may have been in use here and there prior to A.D. 8. Perhaps the most concise algorithm ever devised for calculating the Julian day number from a Gregorian calendar date is pictured below. It is a line of Fortran and fits on a single 80-column punch card. The result is an integer, JD, corresponding to the Julian Day number that begins at Greenwich Mean noon of year Y, month M, day D (all integers). However, this Fortran statement makes use of special rules that don't work in most versions of Basic. The absence of explicit decimal points forces execution by integer arithmetic; division by an integer leads to an integer quotient, and the remainder is discarded. (For example, 5/2 = 2, and -10/6 = -1.) The natural approach is to rewrite the lines, using the INT function of Basic. But all microcomputer Basics evaluate INT(5/2) as 2, while INT(-10/6) becomes -2 instead of -1. Therefore, we have taken special care in designing Listing 1, a program based on the single line of Fortran but with added features. It will work with either the Gregorian or Julian calendars, and with either negative or positive years. Moreover, the program should run correctly on any microcomputer that works to at least seven digit accuracy. JD=367*Y-7*(Y+(M+9)/12)/4-3*((Y+(M-9)/7)/100+1)/4+275*M/9+D+1721029 This remarkable one-line Fortran statement converts a Gregorian calendar date into a Julian Day number. It appeared in Astrophysical Journal Supplement Series, 41, 1979, page 392, after being devised in 1968 by H.F.Fliegel and T.C.Van Flandern and later "compacted" by P.M.Muller and R.N.Wimberly. It is designed for A.D. years only and requires some changes before being used in a Basic program (see text). Astronomical Computing Page 2 of 6 Initially we input Y, M, and D, and set G = 1 for the Gregorian calendar or G = 0 for the Julian one. The day D can be entered to five decimal places or more. Then the program determines the integer part J and fractional part F of the Julian date. It is very important not to add J and F together; they must be kept as separate integer and fractional parts throughout a working program so as not to lose accuracy, unless a high precision Basic is used. Listing 1 800 REM CALENDAR --> JD 805 REM 810 INPUT "Y,M,D ";Y,M,D 815 INPUT "JC (0) OR GC (1) ";G 820 D1=INT(D): F=D-D1-0.5 825 J=-INT(7*(INT((M+9)/12)+Y)/4) 830 IF G=0 THEN 850 835 S=SGN(M-9): A=ABS(M-9) 840 J1=INT(Y+S*INT(A/7)) 845 J1=-INT((INT(J1/100)+1)*3/4) 850 J=J+INT(275*M/9)+D1+G*J1 855 J=J+1721027+2*G+367*Y 860 IF F>=0 THEN 870 865 F=F+1: J=J-1 870 PRINT "J.D.: ";J;F 875 END Listing 2 900 REM JD ---> CALENDAR 905 REM 910 INPUT "J,F ";J,F 915 INPUT "JC (0) OR GC (1) ";G 920 F=F+0.5 925 IF F<1 THEN 935 930 F=F-1:J=J+1 935 IF G=1 THEN 945 940 A=J: GOTO 955 945 A1=INT((J/36524.25)-51.12264) 950 A=J+1+A1-INT(A1/4) 955 B=A+1524 960 C=INT((B/365.25)-0.3343) 965 D=INT(365.25*C) 970 E=INT((B-D)/30.61) 975 D=B-D-INT(30.61*E)+F 980 M=E-1: Y=C-4716 985 IF E>13.5 THEN M=M-12 990 IF M<2.5 THEN Y=Y+1 995 PRINT "DATE: ";Y;M;D 997 END Note on variations: With Radio Shack Level II Basic, replace J in line 870 with CDBL(J). In Applesoft, use commas rather than semicolons in lines 870 and 995. Some Basics require a back- slash where colons are used here. Astronomical Computing Page 3 of 6 Listing 2 performs the inverse calculation. Initially, J is the Julian Day number, and F the fractional part of a day. When the program finishes, Y is the year, M the month, and D the day (with fraction). This program is based on the algorithm in Jean Meeus's Astronomical Formulae for Calculators (Willmann- Bell, 1982), with some rearrangement to suit the many micro- computers with only seven digit accuracy. Here again, G determines the calendar style. (The Meeus book also describes the inverse calculation, by a method different from that described here but identical in result.) For example, consider the geocentric conjunction of the Sun and Moon this month. It occurs at 16:52:39 UT on May 30th, so the day is expressed decimally as 30.70323 and the dialogue runs: >RUN "CALJD" Y,M,D ? 1984, 5, 30.70323 JC (0) OR GC (1) ? 1 J.D.: 2445851 .20323 READY >RUN "JDCAL" J,F ? 2445851, .20323 JC (0) OR GC (1) ? 1 DATE: 1984 5 30.70323 READY Future program listings in this department will often make use of the Julian Day number and fraction, so readers may wish to rewrite these listings as subroutines. After replacing each END statement with RETURN, you can simply insert them bodily into other programs. Both listings have been thoroughly tested at Sky & Telescope on many microcomputers, for the years -4712 through to +3500 in both the Gregorian and Julian calendars. But it's wise, when trying out the programs on your own machine, to verify the results on some known equivalents: Julian Cal. Gregorian Cal. Julian Date -4712 Jan. 1.5 -4713 Nov. 24.5 0.0 -2000 Jan. 1.0 -2001 Dec. 15.0 990557.5 -584 May 28.6 -584 May 22.6 1507900.1 +200 Mar. 1.0 +200 Mar. 1.0 1794167.5 +1984 Feb. 16.2 +1984 Feb. 29.2 2445759.7 +1999 Dec. 19.5 +2000 Jan. 1.5 2451545.0 +3000 Feb. 29.9 +3000 Mar. 21.9 2816867.4 Many ancient calendars have been linked by Julian Day number in O.L.Harvey's new booklet, Calendar Conversions (American Philosophical Society, 1983). He also mentions two useful tricks with these numbers. To find the day of the week at noon when each Julian Day number begins, divide the whole number by 7; a remainder of 0 means Monday, 1 Tuesday, and so on, through to 6 for Sunday. Furthermore, the Moon is within a day or so of new on those days when the Julian Day number, divided by 29.530588, yields .33 as the fractional part. Astronomical Computing Page 4 of 6 Prior to 1925, astronomers actually considered each new calendar date to commence at noon on the corresponding civil date. But our programs use the modern convention as to when a calendar day begins, even for dates before 1925. Nevertheless, it is well to remember this change in usage when consulting early astronomical sources. Also beware the "Modified Julian Date" (MJD), defined as the true JD minus 2,400,000.5, and sometimes advocated to help preserve digits in machines of limited precision. In reality, since the first two digits of the JD have been 24 only since 1859, the device is useful only from a narrow modern perspective. More alarming, though, is the danger of confusion introduced by the .5 (intended to make the MJD begin when the civil day does). The coexistence of this with another common device, that of simply lopping off the highest few digits of the JD, has often led to a confusion of 12 hours in the astronomical literature. The practice of adjusting the JD by some constant was once described by the late Paul Herget as "an attempt to pervert the established system" of astronomical reckoning. Far better not to tinker with it, and let our machines worry about the details! ROGER W. SINNOTT -----oOo----- From the September 1984 issue of Sky & Telescope, page 255... Milo L. Hurley, Jr., of Aurora, Colorado, writes that our program for computing the Julian date from the calendar date (Listing 1 in the May issue, page 455) does not run properly for negative years when written in Digital Research's CBASIC for his Altos computer. He has traced the problem to the INT function, which takes the integer part of a number. In CBASIC (as on many pocket calculators), the integer part of a negative number is obtained by truncating the decimal part; thus, both (INT-3.2) and INT(-3.8) yield -3. In all the other microcomputer Basics we've tried, the answer is -4 in these two cases. A remedy in CBASIC is to set up a user-defined function that mimics Basics of the other type, and to substitute this for INT throughout the program. The Basics that give -4 appear to be the clear majority, and with them the calendar program works without modification. These include the Microsoft versions running on the Apple, Radio Shack, and Ohio Scientific machines, and also North Star, Digital Equipment, and Hewlett-Packard Basics. -----oOo----- Astronomical Computing Page 5 of 6 Electronic News Service Computer owners with modems can obtain fast news from Sky & Telescope of comet and nova discoveries, and also program listings from the Astronomical Computing Department. After joining CompuServe (through a local Radio Shack or computer dealer), log on and move to Personal Computing and then the Personal File Area. Once there, at any menu, type R ACCESS Then at the next menu type R NEWS.DAT[70275,125] to receive this service. Astronomical Computing Page 6 of 6
00000000 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 |.... | 00000010 20 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 61 | The following a| 00000020 72 74 69 63 6c 65 20 69 73 20 72 65 70 72 6f 64 |rticle is reprod| 00000030 75 63 65 64 20 77 69 74 68 20 70 65 72 6d 69 73 |uced with permis| 00000040 73 69 6f 6e 20 66 72 6f 6d 0d 0a 20 20 20 20 20 |sion from.. | 00000050 20 20 20 74 68 65 20 4d 61 79 20 31 39 38 34 20 | the May 1984 | 00000060 69 73 73 75 65 20 6f 66 20 53 6b 79 20 26 20 54 |issue of Sky & T| 00000070 65 6c 65 73 63 6f 70 65 20 6d 61 67 61 7a 69 6e |elescope magazin| 00000080 65 2c 20 61 6e 64 20 72 65 6d 61 69 6e 73 20 74 |e, and remains t| 00000090 68 65 0d 0a 20 20 20 20 20 20 20 20 63 6f 70 79 |he.. copy| 000000a0 72 69 67 68 74 20 6f 66 20 74 68 65 20 53 6b 79 |right of the Sky| 000000b0 20 50 75 62 6c 69 73 68 69 6e 67 20 43 6f 72 70 | Publishing Corp| 000000c0 6f 72 61 74 69 6f 6e 2e 0d 0a 0d 0a 20 20 20 20 |oration..... | 000000d0 20 20 20 20 54 68 65 20 22 53 6b 79 20 26 20 54 | The "Sky & T| 000000e0 65 6c 65 73 63 6f 70 65 22 20 6d 61 67 61 7a 69 |elescope" magazi| 000000f0 6e 65 20 28 49 53 53 4e 20 30 30 33 37 2d 36 36 |ne (ISSN 0037-66| 00000100 30 34 29 20 69 73 20 70 75 62 6c 69 73 68 65 64 |04) is published| 00000110 0d 0a 20 20 20 20 20 20 20 20 6d 6f 6e 74 68 6c |.. monthl| 00000120 79 20 62 79 3a 0d 0a 0d 0a 20 20 20 20 20 20 20 |y by:.... | 00000130 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000140 20 20 20 53 6b 79 20 50 75 62 6c 69 73 68 69 6e | Sky Publishin| 00000150 67 20 43 6f 72 70 6f 72 61 74 69 6f 6e 2c 0d 0a |g Corporation,..| 00000160 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000170 20 20 20 20 20 20 20 20 20 20 34 39 2c 20 42 61 | 49, Ba| 00000180 79 20 53 74 61 74 65 20 52 6f 61 64 2c 0d 0a 20 |y State Road,.. | 00000190 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000001a0 20 20 20 20 20 20 20 20 20 43 61 6d 62 72 69 64 | Cambrid| 000001b0 67 65 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 |ge,.. | 000001c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4d | M| 000001d0 61 73 73 2e 20 20 30 32 32 33 38 2d 31 32 39 30 |ass. 02238-1290| 000001e0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |.. | 000001f0 20 20 20 20 20 20 20 20 20 20 20 20 55 2e 53 2e | U.S.| 00000200 41 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 |A..... | 00000210 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000220 20 20 20 20 20 20 20 2d 2d 2d 2d 2d 6f 4f 6f 2d | -----oOo-| 00000230 2d 2d 2d 2d 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 20 20 |----.......... | 00000240 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000250 20 20 20 20 20 20 20 20 20 20 41 73 74 72 6f 6e | Astron| 00000260 6f 6d 69 63 61 6c 20 20 43 6f 6d 70 75 74 69 6e |omical Computin| 00000270 67 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 |g.... | 00000280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 43 6f | Co| 00000290 6e 64 75 63 74 65 64 20 62 79 20 52 6f 67 65 72 |nducted by Roger| 000002a0 20 57 2e 20 53 69 6e 6e 6f 74 74 0d 0a 0d 0a 0d | W. Sinnott.....| 000002b0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |. | 000002c0 20 20 20 20 20 20 20 20 20 20 20 54 61 6d 69 6e | Tamin| 000002d0 67 20 4f 75 72 20 43 68 61 6f 74 69 63 20 43 61 |g Our Chaotic Ca| 000002e0 6c 65 6e 64 61 72 0d 0a 0d 0a 0d 0a 0d 0a 20 20 |lendar........ | 000002f0 20 20 20 20 20 20 20 20 20 20 20 41 20 72 6f 75 | A rou| 00000300 74 69 6e 65 20 66 6f 72 20 63 61 6c 65 6e 64 61 |tine for calenda| 00000310 72 20 63 6f 6e 76 65 72 73 69 6f 6e 20 6c 69 65 |r conversion lie| 00000320 73 20 61 74 20 74 68 65 20 68 65 61 72 74 20 6f |s at the heart o| 00000330 66 20 6d 61 6e 79 0d 0a 20 20 20 20 20 20 20 20 |f many.. | 00000340 61 73 74 72 6f 6e 6f 6d 69 63 61 6c 20 70 72 6f |astronomical pro| 00000350 67 72 61 6d 73 2e 20 20 4f 66 74 65 6e 20 77 65 |grams. Often we| 00000360 20 77 61 6e 74 20 61 20 63 6f 6d 70 75 74 65 72 | want a computer| 00000370 20 74 6f 20 63 61 6c 63 75 6c 61 74 65 0d 0a 20 | to calculate.. | 00000380 20 20 20 20 20 20 20 73 6f 6d 65 74 68 69 6e 67 | something| 00000390 20 66 6f 72 20 61 20 70 61 72 74 69 63 75 6c 61 | for a particula| 000003a0 72 20 64 61 74 65 20 61 6e 64 20 74 69 6d 65 2c |r date and time,| 000003b0 20 6f 72 20 74 6f 20 74 65 6c 6c 20 75 73 20 74 | or to tell us t| 000003c0 68 65 20 64 61 79 0d 0a 20 20 20 20 20 20 20 20 |he day.. | 000003d0 61 6e 64 20 6d 6f 6e 74 68 20 77 68 65 6e 20 61 |and month when a| 000003e0 6e 20 65 76 65 6e 74 20 77 69 6c 6c 20 6f 63 63 |n event will occ| 000003f0 75 72 20 28 61 6e 20 65 63 6c 69 70 73 65 20 6f |ur (an eclipse o| 00000400 72 20 6f 63 63 75 6c 74 61 74 69 6f 6e 2c 0d 0a |r occultation,..| 00000410 20 20 20 20 20 20 20 20 70 65 72 68 61 70 73 29 | perhaps)| 00000420 2e 20 20 44 69 67 69 74 61 6c 20 77 61 74 63 68 |. Digital watch| 00000430 65 73 20 6f 66 74 65 6e 20 66 61 69 6c 20 61 74 |es often fail at| 00000440 20 64 61 74 65 20 63 6f 6e 76 65 72 73 69 6f 6e | date conversion| 00000450 2c 20 61 6e 64 0d 0a 20 20 20 20 20 20 20 20 6c |, and.. l| 00000460 61 73 74 20 46 65 62 72 75 61 72 79 20 32 39 74 |ast February 29t| 00000470 68 20 71 75 69 74 65 20 61 20 66 65 77 20 6f 66 |h quite a few of| 00000480 20 74 68 65 6d 20 61 72 6f 75 6e 64 20 74 68 65 | them around the| 00000490 20 77 6f 72 6c 64 20 70 72 6f 62 61 62 6c 79 0d | world probably.| 000004a0 0a 20 20 20 20 20 20 20 20 69 6e 64 69 63 61 74 |. indicat| 000004b0 65 64 20 4d 61 72 63 68 20 31 73 74 2e 20 20 54 |ed March 1st. T| 000004c0 6f 20 6d 61 6b 65 20 6f 75 72 20 63 6f 6d 70 75 |o make our compu| 000004d0 74 65 72 20 72 6f 75 74 69 6e 65 73 20 61 73 20 |ter routines as | 000004e0 75 6e 69 76 65 72 73 61 6c 0d 0a 20 20 20 20 20 |universal.. | 000004f0 20 20 20 61 73 20 70 6f 73 73 69 62 6c 65 2c 20 | as possible, | 00000500 6c 65 74 27 73 20 6c 61 79 20 64 6f 77 6e 20 63 |let's lay down c| 00000510 65 72 74 61 69 6e 20 66 69 72 6d 20 65 78 70 65 |ertain firm expe| 00000520 63 74 61 74 69 6f 6e 73 20 66 6f 72 20 74 68 65 |ctations for the| 00000530 6d 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 |m..... | 00000540 20 20 20 46 69 72 73 74 20 6f 66 20 61 6c 6c 2c | First of all,| 00000550 20 74 68 65 20 6d 61 63 68 69 6e 65 20 73 68 6f | the machine sho| 00000560 75 6c 64 20 22 72 65 73 6f 6c 76 65 22 20 69 6e |uld "resolve" in| 00000570 74 65 72 76 61 6c 73 20 61 73 0d 0a 20 20 20 20 |tervals as.. | 00000580 20 20 20 20 73 6d 61 6c 6c 20 61 73 20 31 20 73 | small as 1 s| 00000590 65 63 6f 6e 64 20 6f 66 20 74 69 6d 65 20 28 74 |econd of time (t| 000005a0 68 61 74 20 69 73 2c 20 61 62 6f 75 74 20 30 2e |hat is, about 0.| 000005b0 30 30 30 30 31 20 64 61 79 29 2e 20 20 49 74 0d |00001 day). It.| 000005c0 0a 20 20 20 20 20 20 20 20 74 61 6b 65 73 20 6f |. takes o| 000005d0 6e 6c 79 20 61 20 6c 69 74 74 6c 65 20 65 66 66 |nly a little eff| 000005e0 6f 72 74 20 74 6f 20 62 75 69 6c 64 20 74 68 69 |ort to build thi| 000005f0 73 20 61 63 63 75 72 61 63 79 20 69 6e 74 6f 20 |s accuracy into | 00000600 6f 75 72 0d 0a 20 20 20 20 20 20 20 20 63 61 6c |our.. cal| 00000610 65 6e 64 61 72 20 63 6f 6e 76 65 72 73 69 6f 6e |endar conversion| 00000620 20 72 6f 75 74 69 6e 65 73 20 73 6f 20 74 68 65 | routines so the| 00000630 79 20 77 6f 6e 27 74 20 6e 65 65 64 20 6c 61 74 |y won't need lat| 00000640 65 72 20 72 65 76 69 73 69 6f 6e 0d 0a 20 20 20 |er revision.. | 00000650 20 20 20 20 20 66 6f 72 20 73 70 65 63 69 61 6c | for special| 00000660 20 70 72 6f 67 72 61 6d 73 2e 0d 0a 0d 0a 20 20 | programs..... | 00000670 20 20 20 20 20 20 20 20 20 20 20 53 65 63 6f 6e | Secon| 00000680 64 2c 20 6c 65 74 27 73 20 61 76 6f 69 64 20 73 |d, let's avoid s| 00000690 69 6d 70 6c 65 2d 6c 6f 6f 6b 69 6e 67 20 70 72 |imple-looking pr| 000006a0 6f 63 65 64 75 72 65 73 20 74 68 61 74 20 6f 6e |ocedures that on| 000006b0 6c 79 0d 0a 20 20 20 20 20 20 20 20 77 6f 72 6b |ly.. work| 000006c0 20 62 65 74 77 65 65 6e 20 63 65 72 74 61 69 6e | between certain| 000006d0 20 79 65 61 72 73 20 28 66 6f 72 20 65 78 61 6d | years (for exam| 000006e0 70 6c 65 2c 20 41 2e 44 2e 20 31 39 30 31 20 74 |ple, A.D. 1901 t| 000006f0 6f 20 32 30 39 39 29 2e 0d 0a 20 20 20 20 20 20 |o 2099)... | 00000700 20 20 53 6f 6f 6e 65 72 20 6f 72 20 6c 61 74 65 | Sooner or late| 00000710 72 2c 20 77 65 27 6c 6c 20 70 72 6f 62 61 62 6c |r, we'll probabl| 00000720 79 20 61 74 74 65 6d 70 74 20 61 20 63 61 6c 63 |y attempt a calc| 00000730 75 6c 61 74 69 6f 6e 20 6f 75 74 73 69 64 65 0d |ulation outside.| 00000740 0a 20 20 20 20 20 20 20 20 74 68 69 73 20 69 6e |. this in| 00000750 74 65 72 76 61 6c 2c 20 6c 69 74 74 6c 65 20 73 |terval, little s| 00000760 75 73 70 65 63 74 69 6e 67 20 74 68 61 74 20 74 |uspecting that t| 00000770 68 65 20 63 6f 6d 70 75 74 65 72 20 77 69 6c 6c |he computer will| 00000780 0d 0a 20 20 20 20 20 20 20 20 6d 69 73 69 6e 74 |.. misint| 00000790 65 72 70 72 65 74 20 61 20 64 61 74 65 20 77 65 |erpret a date we| 000007a0 27 76 65 20 65 6e 74 65 72 65 64 2c 20 75 73 75 |'ve entered, usu| 000007b0 61 6c 6c 79 20 62 79 20 73 6f 6d 65 20 77 68 6f |ally by some who| 000007c0 6c 65 20 6e 75 6d 62 65 72 0d 0a 20 20 20 20 20 |le number.. | 000007d0 20 20 20 6f 66 20 64 61 79 73 21 0d 0a 0d 0a 20 | of days!.... | 000007e0 20 20 20 20 20 20 20 20 20 20 20 20 54 6f 20 65 | To e| 000007f0 78 70 72 65 73 73 20 61 6e 20 69 6e 73 74 61 6e |xpress an instan| 00000800 74 20 69 6e 74 65 72 6e 61 6c 6c 79 20 69 6e 20 |t internally in | 00000810 74 68 65 20 63 6f 6d 70 75 74 65 72 2c 20 77 65 |the computer, we| 00000820 27 6c 6c 20 75 73 65 0d 0a 20 20 20 20 20 20 20 |'ll use.. | 00000830 20 4a 75 6c 69 61 6e 20 64 61 79 20 6e 75 6d 62 | Julian day numb| 00000840 65 72 73 20 61 6e 64 20 66 72 61 63 74 69 6f 6e |ers and fraction| 00000850 73 2c 20 61 73 20 66 69 72 73 74 20 61 70 70 6c |s, as first appl| 00000860 69 65 64 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 |ied to.. | 00000870 61 73 74 72 6f 6e 6f 6d 69 63 61 6c 20 6f 62 73 |astronomical obs| 00000880 65 72 76 61 74 69 6f 6e 73 20 62 79 20 4a 6f 68 |ervations by Joh| 00000890 6e 20 48 65 72 73 63 68 65 6c 2e 20 20 54 68 65 |n Herschel. The| 000008a0 20 73 74 61 72 74 69 6e 67 0d 0a 20 20 20 20 20 | starting.. | 000008b0 20 20 20 69 6e 73 74 61 6e 74 20 6f 66 20 74 68 | instant of th| 000008c0 69 73 20 73 79 73 74 65 6d 20 28 74 68 61 74 20 |is system (that | 000008d0 69 73 2c 20 64 61 79 20 30 2e 30 29 20 63 6f 72 |is, day 0.0) cor| 000008e0 72 65 73 70 6f 6e 64 73 20 74 6f 20 6e 6f 6f 6e |responds to noon| 000008f0 2c 0d 0a 20 20 20 20 20 20 20 20 47 72 65 65 6e |,.. Green| 00000900 77 69 63 68 20 4d 65 61 6e 20 54 69 6d 65 2c 20 |wich Mean Time, | 00000910 6f 6e 20 4a 61 6e 75 61 72 79 20 31 2c 20 34 37 |on January 1, 47| 00000920 31 33 20 42 2e 43 2e 20 2d 20 73 75 66 66 69 63 |13 B.C. - suffic| 00000930 69 65 6e 74 6c 79 20 66 61 72 0d 0a 20 20 20 20 |iently far.. | 00000940 20 20 20 20 62 61 63 6b 20 69 6e 20 74 69 6d 65 | back in time| 00000950 20 74 68 61 74 20 77 65 20 73 68 6f 75 6c 64 20 | that we should | 00000960 6e 65 76 65 72 20 68 61 76 65 20 74 6f 20 77 6f |never have to wo| 00000970 72 72 79 20 61 62 6f 75 74 20 6e 65 67 61 74 69 |rry about negati| 00000980 76 65 0d 0a 20 20 20 20 20 20 20 20 64 61 79 20 |ve.. day | 00000990 6e 75 6d 62 65 72 73 20 28 61 6e 64 20 77 6f 6e |numbers (and won| 000009a0 27 74 29 2e 20 20 41 74 20 30 20 68 6f 75 72 73 |'t). At 0 hours| 000009b0 20 55 6e 69 76 65 72 73 61 6c 20 54 69 6d 65 20 | Universal Time | 000009c0 6f 6e 20 61 6e 79 20 64 61 79 2c 0d 0a 20 20 20 |on any day,.. | 000009d0 20 20 20 20 20 74 68 65 20 64 65 63 69 6d 61 6c | the decimal| 000009e0 20 70 61 72 74 20 6f 66 20 74 68 65 20 4a 75 6c | part of the Jul| 000009f0 69 61 6e 20 64 61 74 65 20 69 73 20 2e 35 20 65 |ian date is .5 e| 00000a00 78 61 63 74 6c 79 2e 0d 0a 0d 0a 0d 0a 0d 0a 20 |xactly......... | 00000a10 20 20 20 20 20 20 20 41 73 74 72 6f 6e 6f 6d 69 | Astronomi| 00000a20 63 61 6c 20 43 6f 6d 70 75 74 69 6e 67 20 20 20 |cal Computing | 00000a30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00000a40 20 20 20 20 20 20 20 20 20 20 20 20 50 61 67 65 | Page| 00000a50 20 31 20 6f 66 20 36 0d 0a 0d 0a 0d 0a 0d 0a 0d | 1 of 6.........| 00000a60 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 |... | 00000a70 57 68 61 74 20 61 62 6f 75 74 20 74 68 65 20 63 |What about the c| 00000a80 68 61 6e 67 65 6f 76 65 72 20 66 72 6f 6d 20 74 |hangeover from t| 00000a90 68 65 20 4a 75 6c 69 61 6e 20 63 61 6c 65 6e 64 |he Julian calend| 00000aa0 61 72 20 74 6f 20 74 68 65 0d 0a 20 20 20 20 20 |ar to the.. | 00000ab0 20 20 20 47 72 65 67 6f 72 69 61 6e 3f 20 20 54 | Gregorian? T| 00000ac0 68 65 20 4a 75 6c 69 61 6e 20 63 61 6c 65 6e 64 |he Julian calend| 00000ad0 61 72 20 28 77 68 69 63 68 20 68 61 73 20 6e 6f |ar (which has no| 00000ae0 74 68 69 6e 67 20 74 6f 20 64 6f 20 77 69 74 68 |thing to do with| 00000af0 0d 0a 20 20 20 20 20 20 20 20 4a 75 6c 69 61 6e |.. Julian| 00000b00 20 44 61 79 20 6e 75 6d 62 65 72 73 29 20 68 61 | Day numbers) ha| 00000b10 64 20 73 69 6d 70 6c 65 72 20 6c 65 61 70 2d 79 |d simpler leap-y| 00000b20 65 61 72 20 72 75 6c 65 73 20 61 6e 64 20 77 61 |ear rules and wa| 00000b30 73 20 69 6e 20 77 69 64 65 0d 0a 20 20 20 20 20 |s in wide.. | 00000b40 20 20 20 63 69 76 69 6c 20 75 73 65 20 62 65 66 | civil use bef| 00000b50 6f 72 65 20 41 2e 44 2e 20 31 35 38 32 2e 20 20 |ore A.D. 1582. | 00000b60 54 68 65 20 73 77 69 74 63 68 20 74 6f 20 74 68 |The switch to th| 00000b70 65 20 47 72 65 67 6f 72 69 61 6e 20 77 61 73 0d |e Gregorian was.| 00000b80 0a 20 20 20 20 20 20 20 20 64 65 6c 61 79 65 64 |. delayed| 00000b90 20 75 6e 74 69 6c 20 31 37 35 32 20 69 6e 20 45 | until 1752 in E| 00000ba0 6e 67 6c 61 6e 64 20 61 6e 64 20 74 68 65 20 41 |ngland and the A| 00000bb0 6d 65 72 69 63 61 6e 20 63 6f 6c 6f 6e 69 65 73 |merican colonies| 00000bc0 2c 20 61 6e 64 20 61 73 0d 0a 20 20 20 20 20 20 |, and as.. | 00000bd0 20 20 6c 61 74 65 20 61 73 20 31 38 37 33 20 69 | late as 1873 i| 00000be0 6e 20 4a 61 70 61 6e 20 61 6e 64 20 31 39 32 37 |n Japan and 1927| 00000bf0 20 69 6e 20 54 75 72 6b 65 79 2e 20 20 41 20 73 | in Turkey. A s| 00000c00 70 65 63 69 61 6c 20 66 6c 61 67 20 69 6e 20 61 |pecial flag in a| 00000c10 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 67 72 61 |.. progra| 00000c20 6d 20 63 61 6e 20 65 6e 73 75 72 65 20 74 68 65 |m can ensure the| 00000c30 20 63 6f 6d 70 75 74 65 72 20 69 73 20 6f 72 69 | computer is ori| 00000c40 65 6e 74 65 64 20 74 6f 20 74 68 65 20 70 72 6f |ented to the pro| 00000c50 70 65 72 0d 0a 20 20 20 20 20 20 20 20 63 61 6c |per.. cal| 00000c60 65 6e 64 61 72 2e 0d 0a 0d 0a 20 20 20 20 20 20 |endar..... | 00000c70 20 20 20 20 20 20 20 46 69 6e 61 6c 6c 79 2c 20 | Finally, | 00000c80 69 74 27 73 20 69 6d 70 6f 72 74 61 6e 74 20 74 |it's important t| 00000c90 6f 20 64 69 73 74 69 6e 67 75 69 73 68 20 41 2e |o distinguish A.| 00000ca0 44 2e 20 61 6e 64 20 42 2e 43 2e 20 79 65 61 72 |D. and B.C. year| 00000cb0 73 0d 0a 20 20 20 20 20 20 20 20 73 6f 6d 65 68 |s.. someh| 00000cc0 6f 77 2e 20 20 54 68 65 20 73 74 61 6e 64 61 72 |ow. The standar| 00000cd0 64 20 77 61 79 20 74 6f 20 64 6f 20 74 68 69 73 |d way to do this| 00000ce0 20 72 65 67 61 72 64 73 20 41 2e 44 2e 20 79 65 | regards A.D. ye| 00000cf0 61 72 73 20 61 73 0d 0a 20 20 20 20 20 20 20 20 |ars as.. | 00000d00 70 6f 73 69 74 69 76 65 20 77 68 6f 6c 65 20 6e |positive whole n| 00000d10 75 6d 62 65 72 73 3b 20 31 20 42 2e 43 2e 20 69 |umbers; 1 B.C. i| 00000d20 73 20 63 61 6c 6c 65 64 20 74 68 65 20 79 65 61 |s called the yea| 00000d30 72 20 30 2c 20 32 20 42 2e 43 2e 20 69 73 0d 0a |r 0, 2 B.C. is..| 00000d40 20 20 20 20 20 20 20 20 2d 31 2c 20 33 20 42 2e | -1, 3 B.| 00000d50 43 2e 20 69 73 20 2d 32 2c 20 61 6e 64 20 73 6f |C. is -2, and so| 00000d60 20 6f 6e 2e 20 20 54 68 69 73 20 68 65 6c 70 73 | on. This helps| 00000d70 20 6b 65 65 70 20 6c 65 61 70 20 79 65 61 72 73 | keep leap years| 00000d80 0d 0a 20 20 20 20 20 20 20 20 73 74 72 61 69 67 |.. straig| 00000d90 68 74 2e 20 20 4a 75 6c 69 75 73 20 43 61 65 73 |ht. Julius Caes| 00000da0 61 72 20 69 6e 74 72 6f 64 75 63 65 64 20 68 69 |ar introduced hi| 00000db0 73 20 63 61 6c 65 6e 64 61 72 20 72 65 66 6f 72 |s calendar refor| 00000dc0 6d 20 69 6e 20 74 68 65 0d 0a 20 20 20 20 20 20 |m in the.. | 00000dd0 20 20 79 65 61 72 20 34 35 20 42 2e 43 2e 2c 20 | year 45 B.C., | 00000de0 77 68 69 63 68 20 62 65 63 6f 6d 65 73 20 2d 34 |which becomes -4| 00000df0 34 20 6f 6e 20 6f 75 72 20 73 63 68 65 6d 65 2e |4 on our scheme.| 00000e00 20 20 41 6e 64 20 73 69 6e 63 65 20 74 68 61 74 | And since that| 00000e10 0d 0a 20 20 20 20 20 20 20 20 77 61 73 20 69 6e |.. was in| 00000e20 20 66 61 63 74 20 6c 65 61 70 20 79 65 61 72 2c | fact leap year,| 00000e30 20 74 68 65 20 6d 6f 64 65 72 6e 20 64 69 76 69 | the modern divi| 00000e40 64 65 2d 62 79 2d 66 6f 75 72 20 72 75 6c 65 20 |de-by-four rule | 00000e50 61 70 70 6c 69 65 73 20 74 6f 0d 0a 20 20 20 20 |applies to.. | 00000e60 20 20 20 20 6e 65 67 61 74 69 76 65 20 61 73 20 | negative as | 00000e70 77 65 6c 6c 20 61 73 20 70 6f 73 69 74 69 76 65 |well as positive| 00000e80 20 79 65 61 72 73 2e 20 20 28 52 65 61 64 65 72 | years. (Reader| 00000e90 73 20 61 72 65 20 77 61 72 6e 65 64 20 74 68 61 |s are warned tha| 00000ea0 74 0d 0a 20 20 20 20 20 20 20 20 73 6f 6d 65 20 |t.. some | 00000eb0 72 65 63 65 6e 74 20 62 6f 6f 6b 73 20 61 6e 64 |recent books and| 00000ec0 20 61 72 74 69 63 6c 65 73 20 68 61 76 65 20 75 | articles have u| 00000ed0 73 65 64 20 74 68 65 20 6e 6f 74 61 74 69 6f 6e |sed the notation| 00000ee0 20 31 20 42 2e 43 2e 20 3d 0d 0a 20 20 20 20 20 | 1 B.C. =.. | 00000ef0 20 20 20 2d 31 2c 20 61 6e 64 20 32 20 42 2e 43 | -1, and 2 B.C| 00000f00 2e 20 3d 20 2d 32 2c 20 61 20 76 65 72 79 20 63 |. = -2, a very c| 00000f10 6f 6e 66 75 73 69 6e 67 20 73 79 6d 62 6f 6c 69 |onfusing symboli| 00000f20 73 6d 2e 29 0d 0a 0d 0a 20 20 20 20 20 20 20 20 |sm.).... | 00000f30 20 20 20 20 20 54 68 65 20 4a 75 6c 69 61 6e 20 | The Julian | 00000f40 63 61 6c 65 6e 64 61 72 20 64 69 64 20 6e 6f 74 |calendar did not| 00000f50 20 72 65 61 6c 6c 79 20 63 6f 6d 65 20 69 6e 74 | really come int| 00000f60 6f 20 63 6f 6e 73 69 73 74 65 6e 74 0d 0a 20 20 |o consistent.. | 00000f70 20 20 20 20 20 20 63 69 76 69 6c 20 75 73 65 20 | civil use | 00000f80 75 6e 74 69 6c 20 61 66 74 65 72 20 41 2e 44 2e |until after A.D.| 00000f90 20 38 2e 20 20 42 75 74 20 63 68 72 6f 6e 6f 6c | 8. But chronol| 00000fa0 6f 67 65 72 73 20 63 75 73 74 6f 6d 61 72 69 6c |ogers customaril| 00000fb0 79 0d 0a 20 20 20 20 20 20 20 20 65 78 74 72 61 |y.. extra| 00000fc0 70 6f 6c 61 74 65 20 69 74 20 62 61 63 6b 77 61 |polate it backwa| 00000fd0 72 64 73 20 61 6e 64 20 63 61 6c 6c 20 69 74 20 |rds and call it | 00000fe0 74 68 65 20 4a 75 6c 69 61 6e 20 70 72 6f 6c 65 |the Julian prole| 00000ff0 70 74 69 63 0d 0a 20 20 20 20 20 20 20 20 63 61 |ptic.. ca| 00001000 6c 65 6e 64 61 72 20 74 6f 20 64 69 73 74 69 6e |lendar to distin| 00001010 67 75 69 73 68 20 69 74 20 66 72 6f 6d 20 74 68 |guish it from th| 00001020 65 20 76 61 72 69 6f 75 73 20 63 69 76 69 6c 20 |e various civil | 00001030 63 61 6c 65 6e 64 61 72 73 20 74 68 61 74 0d 0a |calendars that..| 00001040 20 20 20 20 20 20 20 20 6d 61 79 20 68 61 76 65 | may have| 00001050 20 62 65 65 6e 20 69 6e 20 75 73 65 20 68 65 72 | been in use her| 00001060 65 20 61 6e 64 20 74 68 65 72 65 20 70 72 69 6f |e and there prio| 00001070 72 20 74 6f 20 41 2e 44 2e 20 38 2e 0d 0a 0d 0a |r to A.D. 8.....| 00001080 20 20 20 20 20 20 20 20 20 20 20 20 20 50 65 72 | Per| 00001090 68 61 70 73 20 74 68 65 20 6d 6f 73 74 20 63 6f |haps the most co| 000010a0 6e 63 69 73 65 20 61 6c 67 6f 72 69 74 68 6d 20 |ncise algorithm | 000010b0 65 76 65 72 20 64 65 76 69 73 65 64 20 66 6f 72 |ever devised for| 000010c0 0d 0a 20 20 20 20 20 20 20 20 63 61 6c 63 75 6c |.. calcul| 000010d0 61 74 69 6e 67 20 74 68 65 20 4a 75 6c 69 61 6e |ating the Julian| 000010e0 20 64 61 79 20 6e 75 6d 62 65 72 20 66 72 6f 6d | day number from| 000010f0 20 61 20 47 72 65 67 6f 72 69 61 6e 20 63 61 6c | a Gregorian cal| 00001100 65 6e 64 61 72 20 64 61 74 65 0d 0a 20 20 20 20 |endar date.. | 00001110 20 20 20 20 69 73 20 70 69 63 74 75 72 65 64 20 | is pictured | 00001120 62 65 6c 6f 77 2e 20 20 49 74 20 69 73 20 61 20 |below. It is a | 00001130 6c 69 6e 65 20 6f 66 20 46 6f 72 74 72 61 6e 20 |line of Fortran | 00001140 61 6e 64 20 66 69 74 73 20 6f 6e 20 61 20 73 69 |and fits on a si| 00001150 6e 67 6c 65 0d 0a 20 20 20 20 20 20 20 20 38 30 |ngle.. 80| 00001160 2d 63 6f 6c 75 6d 6e 20 70 75 6e 63 68 20 63 61 |-column punch ca| 00001170 72 64 2e 20 20 54 68 65 20 72 65 73 75 6c 74 20 |rd. The result | 00001180 69 73 20 61 6e 20 69 6e 74 65 67 65 72 2c 20 4a |is an integer, J| 00001190 44 2c 0d 0a 20 20 20 20 20 20 20 20 63 6f 72 72 |D,.. corr| 000011a0 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 74 68 65 |esponding to the| 000011b0 20 4a 75 6c 69 61 6e 20 44 61 79 20 6e 75 6d 62 | Julian Day numb| 000011c0 65 72 20 74 68 61 74 20 62 65 67 69 6e 73 20 61 |er that begins a| 000011d0 74 20 47 72 65 65 6e 77 69 63 68 0d 0a 20 20 20 |t Greenwich.. | 000011e0 20 20 20 20 20 4d 65 61 6e 20 6e 6f 6f 6e 20 6f | Mean noon o| 000011f0 66 20 79 65 61 72 20 59 2c 20 6d 6f 6e 74 68 20 |f year Y, month | 00001200 4d 2c 20 64 61 79 20 44 20 28 61 6c 6c 20 69 6e |M, day D (all in| 00001210 74 65 67 65 72 73 29 2e 0d 0a 0d 0a 20 20 20 20 |tegers)..... | 00001220 20 20 20 20 20 20 20 20 20 48 6f 77 65 76 65 72 | However| 00001230 2c 20 74 68 69 73 20 46 6f 72 74 72 61 6e 20 73 |, this Fortran s| 00001240 74 61 74 65 6d 65 6e 74 20 6d 61 6b 65 73 20 75 |tatement makes u| 00001250 73 65 20 6f 66 20 73 70 65 63 69 61 6c 20 72 75 |se of special ru| 00001260 6c 65 73 0d 0a 20 20 20 20 20 20 20 20 74 68 61 |les.. tha| 00001270 74 20 64 6f 6e 27 74 20 77 6f 72 6b 20 69 6e 20 |t don't work in | 00001280 6d 6f 73 74 20 76 65 72 73 69 6f 6e 73 20 6f 66 |most versions of| 00001290 20 42 61 73 69 63 2e 20 20 54 68 65 20 61 62 73 | Basic. The abs| 000012a0 65 6e 63 65 20 6f 66 0d 0a 20 20 20 20 20 20 20 |ence of.. | 000012b0 20 65 78 70 6c 69 63 69 74 20 64 65 63 69 6d 61 | explicit decima| 000012c0 6c 20 70 6f 69 6e 74 73 20 66 6f 72 63 65 73 20 |l points forces | 000012d0 65 78 65 63 75 74 69 6f 6e 20 62 79 20 69 6e 74 |execution by int| 000012e0 65 67 65 72 20 61 72 69 74 68 6d 65 74 69 63 3b |eger arithmetic;| 000012f0 0d 0a 20 20 20 20 20 20 20 20 64 69 76 69 73 69 |.. divisi| 00001300 6f 6e 20 62 79 20 61 6e 20 69 6e 74 65 67 65 72 |on by an integer| 00001310 20 6c 65 61 64 73 20 74 6f 20 61 6e 20 69 6e 74 | leads to an int| 00001320 65 67 65 72 20 71 75 6f 74 69 65 6e 74 2c 20 61 |eger quotient, a| 00001330 6e 64 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 |nd the.. | 00001340 72 65 6d 61 69 6e 64 65 72 20 69 73 20 64 69 73 |remainder is dis| 00001350 63 61 72 64 65 64 2e 20 20 28 46 6f 72 20 65 78 |carded. (For ex| 00001360 61 6d 70 6c 65 2c 20 35 2f 32 20 3d 20 32 2c 20 |ample, 5/2 = 2, | 00001370 61 6e 64 20 2d 31 30 2f 36 20 3d 20 2d 31 2e 29 |and -10/6 = -1.)| 00001380 0d 0a 20 20 20 20 20 20 20 20 54 68 65 20 6e 61 |.. The na| 00001390 74 75 72 61 6c 20 61 70 70 72 6f 61 63 68 20 69 |tural approach i| 000013a0 73 20 74 6f 20 72 65 77 72 69 74 65 20 74 68 65 |s to rewrite the| 000013b0 20 6c 69 6e 65 73 2c 20 75 73 69 6e 67 20 74 68 | lines, using th| 000013c0 65 20 49 4e 54 0d 0a 20 20 20 20 20 20 20 20 66 |e INT.. f| 000013d0 75 6e 63 74 69 6f 6e 20 6f 66 20 42 61 73 69 63 |unction of Basic| 000013e0 2e 20 20 42 75 74 20 61 6c 6c 20 6d 69 63 72 6f |. But all micro| 000013f0 63 6f 6d 70 75 74 65 72 20 42 61 73 69 63 73 20 |computer Basics | 00001400 65 76 61 6c 75 61 74 65 0d 0a 20 20 20 20 20 20 |evaluate.. | 00001410 20 20 49 4e 54 28 35 2f 32 29 20 61 73 20 32 2c | INT(5/2) as 2,| 00001420 20 77 68 69 6c 65 20 49 4e 54 28 2d 31 30 2f 36 | while INT(-10/6| 00001430 29 20 62 65 63 6f 6d 65 73 20 2d 32 20 69 6e 73 |) becomes -2 ins| 00001440 74 65 61 64 20 6f 66 20 2d 31 2e 0d 0a 0d 0a 20 |tead of -1..... | 00001450 20 20 20 20 20 20 20 20 20 20 20 20 54 68 65 72 | Ther| 00001460 65 66 6f 72 65 2c 20 77 65 20 68 61 76 65 20 74 |efore, we have t| 00001470 61 6b 65 6e 20 73 70 65 63 69 61 6c 20 63 61 72 |aken special car| 00001480 65 20 69 6e 20 64 65 73 69 67 6e 69 6e 67 20 4c |e in designing L| 00001490 69 73 74 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 |isting.. | 000014a0 31 2c 20 61 20 70 72 6f 67 72 61 6d 20 62 61 73 |1, a program bas| 000014b0 65 64 20 6f 6e 20 74 68 65 20 73 69 6e 67 6c 65 |ed on the single| 000014c0 20 6c 69 6e 65 20 6f 66 20 46 6f 72 74 72 61 6e | line of Fortran| 000014d0 20 62 75 74 20 77 69 74 68 20 61 64 64 65 64 0d | but with added.| 000014e0 0a 20 20 20 20 20 20 20 20 66 65 61 74 75 72 65 |. feature| 000014f0 73 2e 20 20 49 74 20 77 69 6c 6c 20 77 6f 72 6b |s. It will work| 00001500 20 77 69 74 68 20 65 69 74 68 65 72 20 74 68 65 | with either the| 00001510 20 47 72 65 67 6f 72 69 61 6e 20 6f 72 20 4a 75 | Gregorian or Ju| 00001520 6c 69 61 6e 0d 0a 20 20 20 20 20 20 20 20 63 61 |lian.. ca| 00001530 6c 65 6e 64 61 72 73 2c 20 61 6e 64 20 77 69 74 |lendars, and wit| 00001540 68 20 65 69 74 68 65 72 20 6e 65 67 61 74 69 76 |h either negativ| 00001550 65 20 6f 72 20 70 6f 73 69 74 69 76 65 20 79 65 |e or positive ye| 00001560 61 72 73 2e 0d 0a 20 20 20 20 20 20 20 20 4d 6f |ars... Mo| 00001570 72 65 6f 76 65 72 2c 20 74 68 65 20 70 72 6f 67 |reover, the prog| 00001580 72 61 6d 20 73 68 6f 75 6c 64 20 72 75 6e 20 63 |ram should run c| 00001590 6f 72 72 65 63 74 6c 79 20 6f 6e 20 61 6e 79 20 |orrectly on any | 000015a0 6d 69 63 72 6f 63 6f 6d 70 75 74 65 72 0d 0a 20 |microcomputer.. | 000015b0 20 20 20 20 20 20 20 74 68 61 74 20 77 6f 72 6b | that work| 000015c0 73 20 74 6f 20 61 74 20 6c 65 61 73 74 20 73 65 |s to at least se| 000015d0 76 65 6e 20 64 69 67 69 74 20 61 63 63 75 72 61 |ven digit accura| 000015e0 63 79 2e 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 4a |cy....... J| 000015f0 44 3d 33 36 37 2a 59 2d 37 2a 28 59 2b 28 4d 2b |D=367*Y-7*(Y+(M+| 00001600 39 29 2f 31 32 29 2f 34 2d 33 2a 28 28 59 2b 28 |9)/12)/4-3*((Y+(| 00001610 4d 2d 39 29 2f 37 29 2f 31 30 30 2b 31 29 2f 34 |M-9)/7)/100+1)/4| 00001620 2b 32 37 35 2a 4d 2f 39 2b 44 2b 31 37 32 31 30 |+275*M/9+D+17210| 00001630 32 39 0d 0a 0d 0a 20 20 20 20 20 20 54 68 69 73 |29.... This| 00001640 20 72 65 6d 61 72 6b 61 62 6c 65 20 6f 6e 65 2d | remarkable one-| 00001650 6c 69 6e 65 20 46 6f 72 74 72 61 6e 20 73 74 61 |line Fortran sta| 00001660 74 65 6d 65 6e 74 20 63 6f 6e 76 65 72 74 73 20 |tement converts | 00001670 61 20 47 72 65 67 6f 72 69 61 6e 0d 0a 20 20 20 |a Gregorian.. | 00001680 20 20 20 63 61 6c 65 6e 64 61 72 20 64 61 74 65 | calendar date| 00001690 20 69 6e 74 6f 20 61 20 4a 75 6c 69 61 6e 20 44 | into a Julian D| 000016a0 61 79 20 6e 75 6d 62 65 72 2e 20 20 49 74 20 61 |ay number. It a| 000016b0 70 70 65 61 72 65 64 20 69 6e 20 41 73 74 72 6f |ppeared in Astro| 000016c0 70 68 79 73 69 63 61 6c 0d 0a 20 20 20 20 20 20 |physical.. | 000016d0 4a 6f 75 72 6e 61 6c 20 53 75 70 70 6c 65 6d 65 |Journal Suppleme| 000016e0 6e 74 20 53 65 72 69 65 73 2c 20 34 31 2c 20 31 |nt Series, 41, 1| 000016f0 39 37 39 2c 20 70 61 67 65 20 33 39 32 2c 20 61 |979, page 392, a| 00001700 66 74 65 72 20 62 65 69 6e 67 20 64 65 76 69 73 |fter being devis| 00001710 65 64 20 69 6e 0d 0a 20 20 20 20 20 20 31 39 36 |ed in.. 196| 00001720 38 20 62 79 20 48 2e 46 2e 46 6c 69 65 67 65 6c |8 by H.F.Fliegel| 00001730 20 61 6e 64 20 54 2e 43 2e 56 61 6e 20 46 6c 61 | and T.C.Van Fla| 00001740 6e 64 65 72 6e 20 61 6e 64 20 6c 61 74 65 72 20 |ndern and later | 00001750 22 63 6f 6d 70 61 63 74 65 64 22 20 62 79 0d 0a |"compacted" by..| 00001760 20 20 20 20 20 20 50 2e 4d 2e 4d 75 6c 6c 65 72 | P.M.Muller| 00001770 20 61 6e 64 20 52 2e 4e 2e 57 69 6d 62 65 72 6c | and R.N.Wimberl| 00001780 79 2e 20 20 49 74 20 69 73 20 64 65 73 69 67 6e |y. It is design| 00001790 65 64 20 66 6f 72 20 41 2e 44 2e 20 79 65 61 72 |ed for A.D. year| 000017a0 73 20 6f 6e 6c 79 20 61 6e 64 0d 0a 20 20 20 20 |s only and.. | 000017b0 20 20 72 65 71 75 69 72 65 73 20 73 6f 6d 65 20 | requires some | 000017c0 63 68 61 6e 67 65 73 20 62 65 66 6f 72 65 20 62 |changes before b| 000017d0 65 69 6e 67 20 75 73 65 64 20 69 6e 20 61 20 42 |eing used in a B| 000017e0 61 73 69 63 20 70 72 6f 67 72 61 6d 20 28 73 65 |asic program (se| 000017f0 65 20 74 65 78 74 29 2e 0d 0a 0d 0a 0d 0a 20 20 |e text)....... | 00001800 20 20 20 20 41 73 74 72 6f 6e 6f 6d 69 63 61 6c | Astronomical| 00001810 20 43 6f 6d 70 75 74 69 6e 67 20 20 20 20 20 20 | Computing | 00001820 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00001830 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 50 | P| 00001840 61 67 65 20 32 20 6f 66 20 36 0d 0a 0d 0a 0d 0a |age 2 of 6......| 00001850 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 |...... | 00001860 20 20 20 49 6e 69 74 69 61 6c 6c 79 20 77 65 20 | Initially we | 00001870 69 6e 70 75 74 20 59 2c 20 4d 2c 20 61 6e 64 20 |input Y, M, and | 00001880 44 2c 20 61 6e 64 20 73 65 74 20 47 20 3d 20 31 |D, and set G = 1| 00001890 20 66 6f 72 20 74 68 65 0d 0a 20 20 20 20 20 20 | for the.. | 000018a0 20 20 47 72 65 67 6f 72 69 61 6e 20 63 61 6c 65 | Gregorian cale| 000018b0 6e 64 61 72 20 6f 72 20 47 20 3d 20 30 20 66 6f |ndar or G = 0 fo| 000018c0 72 20 74 68 65 20 4a 75 6c 69 61 6e 20 6f 6e 65 |r the Julian one| 000018d0 2e 20 20 54 68 65 20 64 61 79 20 44 20 63 61 6e |. The day D can| 000018e0 0d 0a 20 20 20 20 20 20 20 20 62 65 20 65 6e 74 |.. be ent| 000018f0 65 72 65 64 20 74 6f 20 66 69 76 65 20 64 65 63 |ered to five dec| 00001900 69 6d 61 6c 20 70 6c 61 63 65 73 20 6f 72 20 6d |imal places or m| 00001910 6f 72 65 2e 20 20 54 68 65 6e 20 74 68 65 20 70 |ore. Then the p| 00001920 72 6f 67 72 61 6d 0d 0a 20 20 20 20 20 20 20 20 |rogram.. | 00001930 64 65 74 65 72 6d 69 6e 65 73 20 74 68 65 20 69 |determines the i| 00001940 6e 74 65 67 65 72 20 70 61 72 74 20 4a 20 61 6e |nteger part J an| 00001950 64 20 66 72 61 63 74 69 6f 6e 61 6c 20 70 61 72 |d fractional par| 00001960 74 20 46 20 6f 66 20 74 68 65 0d 0a 20 20 20 20 |t F of the.. | 00001970 20 20 20 20 4a 75 6c 69 61 6e 20 64 61 74 65 2e | Julian date.| 00001980 20 20 49 74 20 69 73 20 76 65 72 79 20 69 6d 70 | It is very imp| 00001990 6f 72 74 61 6e 74 20 6e 6f 74 20 74 6f 20 61 64 |ortant not to ad| 000019a0 64 20 4a 20 61 6e 64 20 46 20 74 6f 67 65 74 68 |d J and F togeth| 000019b0 65 72 3b 0d 0a 20 20 20 20 20 20 20 20 74 68 65 |er;.. the| 000019c0 79 20 6d 75 73 74 20 62 65 20 6b 65 70 74 20 61 |y must be kept a| 000019d0 73 20 73 65 70 61 72 61 74 65 20 69 6e 74 65 67 |s separate integ| 000019e0 65 72 20 61 6e 64 20 66 72 61 63 74 69 6f 6e 61 |er and fractiona| 000019f0 6c 20 70 61 72 74 73 0d 0a 20 20 20 20 20 20 20 |l parts.. | 00001a00 20 74 68 72 6f 75 67 68 6f 75 74 20 61 20 77 6f | throughout a wo| 00001a10 72 6b 69 6e 67 20 70 72 6f 67 72 61 6d 20 73 6f |rking program so| 00001a20 20 61 73 20 6e 6f 74 20 74 6f 20 6c 6f 73 65 20 | as not to lose | 00001a30 61 63 63 75 72 61 63 79 2c 20 75 6e 6c 65 73 73 |accuracy, unless| 00001a40 0d 0a 20 20 20 20 20 20 20 20 61 20 68 69 67 68 |.. a high| 00001a50 20 70 72 65 63 69 73 69 6f 6e 20 42 61 73 69 63 | precision Basic| 00001a60 20 69 73 20 75 73 65 64 2e 0d 0a 0d 0a 0d 0a 20 | is used....... | 00001a70 20 20 20 20 20 20 20 4c 69 73 74 69 6e 67 20 31 | Listing 1| 00001a80 0d 0a 0d 0a 20 20 20 20 20 20 20 20 38 30 30 20 |.... 800 | 00001a90 52 45 4d 20 20 20 43 41 4c 45 4e 44 41 52 20 2d |REM CALENDAR -| 00001aa0 2d 3e 20 4a 44 0d 0a 20 20 20 20 20 20 20 20 38 |-> JD.. 8| 00001ab0 30 35 20 52 45 4d 0d 0a 20 20 20 20 20 20 20 20 |05 REM.. | 00001ac0 38 31 30 20 49 4e 50 55 54 20 22 59 2c 4d 2c 44 |810 INPUT "Y,M,D| 00001ad0 20 22 3b 59 2c 4d 2c 44 0d 0a 20 20 20 20 20 20 | ";Y,M,D.. | 00001ae0 20 20 38 31 35 20 49 4e 50 55 54 20 22 4a 43 20 | 815 INPUT "JC | 00001af0 28 30 29 20 4f 52 20 47 43 20 28 31 29 20 22 3b |(0) OR GC (1) ";| 00001b00 47 0d 0a 20 20 20 20 20 20 20 20 38 32 30 20 44 |G.. 820 D| 00001b10 31 3d 49 4e 54 28 44 29 3a 20 46 3d 44 2d 44 31 |1=INT(D): F=D-D1| 00001b20 2d 30 2e 35 0d 0a 20 20 20 20 20 20 20 20 38 32 |-0.5.. 82| 00001b30 35 20 4a 3d 2d 49 4e 54 28 37 2a 28 49 4e 54 28 |5 J=-INT(7*(INT(| 00001b40 28 4d 2b 39 29 2f 31 32 29 2b 59 29 2f 34 29 0d |(M+9)/12)+Y)/4).| 00001b50 0a 20 20 20 20 20 20 20 20 38 33 30 20 49 46 20 |. 830 IF | 00001b60 47 3d 30 20 54 48 45 4e 20 38 35 30 0d 0a 20 20 |G=0 THEN 850.. | 00001b70 20 20 20 20 20 20 38 33 35 20 53 3d 53 47 4e 28 | 835 S=SGN(| 00001b80 4d 2d 39 29 3a 20 41 3d 41 42 53 28 4d 2d 39 29 |M-9): A=ABS(M-9)| 00001b90 0d 0a 20 20 20 20 20 20 20 20 38 34 30 20 4a 31 |.. 840 J1| 00001ba0 3d 49 4e 54 28 59 2b 53 2a 49 4e 54 28 41 2f 37 |=INT(Y+S*INT(A/7| 00001bb0 29 29 0d 0a 20 20 20 20 20 20 20 20 38 34 35 20 |)).. 845 | 00001bc0 4a 31 3d 2d 49 4e 54 28 28 49 4e 54 28 4a 31 2f |J1=-INT((INT(J1/| 00001bd0 31 30 30 29 2b 31 29 2a 33 2f 34 29 0d 0a 20 20 |100)+1)*3/4).. | 00001be0 20 20 20 20 20 20 38 35 30 20 4a 3d 4a 2b 49 4e | 850 J=J+IN| 00001bf0 54 28 32 37 35 2a 4d 2f 39 29 2b 44 31 2b 47 2a |T(275*M/9)+D1+G*| 00001c00 4a 31 0d 0a 20 20 20 20 20 20 20 20 38 35 35 20 |J1.. 855 | 00001c10 4a 3d 4a 2b 31 37 32 31 30 32 37 2b 32 2a 47 2b |J=J+1721027+2*G+| 00001c20 33 36 37 2a 59 0d 0a 20 20 20 20 20 20 20 20 38 |367*Y.. 8| 00001c30 36 30 20 49 46 20 46 3e 3d 30 20 54 48 45 4e 20 |60 IF F>=0 THEN | 00001c40 38 37 30 0d 0a 20 20 20 20 20 20 20 20 38 36 35 |870.. 865| 00001c50 20 46 3d 46 2b 31 3a 20 4a 3d 4a 2d 31 0d 0a 20 | F=F+1: J=J-1.. | 00001c60 20 20 20 20 20 20 20 38 37 30 20 50 52 49 4e 54 | 870 PRINT| 00001c70 20 22 4a 2e 44 2e 3a 20 22 3b 4a 3b 46 0d 0a 20 | "J.D.: ";J;F.. | 00001c80 20 20 20 20 20 20 20 38 37 35 20 45 4e 44 0d 0a | 875 END..| 00001c90 0d 0a 0d 0a 20 20 20 20 20 20 20 20 4c 69 73 74 |.... List| 00001ca0 69 6e 67 20 32 0d 0a 0d 0a 20 20 20 20 20 20 20 |ing 2.... | 00001cb0 20 39 30 30 20 52 45 4d 20 20 20 4a 44 20 2d 2d | 900 REM JD --| 00001cc0 2d 3e 20 43 41 4c 45 4e 44 41 52 0d 0a 20 20 20 |-> CALENDAR.. | 00001cd0 20 20 20 20 20 39 30 35 20 52 45 4d 0d 0a 20 20 | 905 REM.. | 00001ce0 20 20 20 20 20 20 39 31 30 20 49 4e 50 55 54 20 | 910 INPUT | 00001cf0 22 4a 2c 46 20 22 3b 4a 2c 46 0d 0a 20 20 20 20 |"J,F ";J,F.. | 00001d00 20 20 20 20 39 31 35 20 49 4e 50 55 54 20 22 4a | 915 INPUT "J| 00001d10 43 20 28 30 29 20 4f 52 20 47 43 20 28 31 29 20 |C (0) OR GC (1) | 00001d20 22 3b 47 0d 0a 20 20 20 20 20 20 20 20 39 32 30 |";G.. 920| 00001d30 20 46 3d 46 2b 30 2e 35 0d 0a 20 20 20 20 20 20 | F=F+0.5.. | 00001d40 20 20 39 32 35 20 49 46 20 46 3c 31 20 54 48 45 | 925 IF F<1 THE| 00001d50 4e 20 39 33 35 0d 0a 20 20 20 20 20 20 20 20 39 |N 935.. 9| 00001d60 33 30 20 46 3d 46 2d 31 3a 4a 3d 4a 2b 31 0d 0a |30 F=F-1:J=J+1..| 00001d70 20 20 20 20 20 20 20 20 39 33 35 20 49 46 20 47 | 935 IF G| 00001d80 3d 31 20 54 48 45 4e 20 39 34 35 0d 0a 20 20 20 |=1 THEN 945.. | 00001d90 20 20 20 20 20 39 34 30 20 41 3d 4a 3a 20 47 4f | 940 A=J: GO| 00001da0 54 4f 20 39 35 35 0d 0a 20 20 20 20 20 20 20 20 |TO 955.. | 00001db0 39 34 35 20 41 31 3d 49 4e 54 28 28 4a 2f 33 36 |945 A1=INT((J/36| 00001dc0 35 32 34 2e 32 35 29 2d 35 31 2e 31 32 32 36 34 |524.25)-51.12264| 00001dd0 29 0d 0a 20 20 20 20 20 20 20 20 39 35 30 20 41 |).. 950 A| 00001de0 3d 4a 2b 31 2b 41 31 2d 49 4e 54 28 41 31 2f 34 |=J+1+A1-INT(A1/4| 00001df0 29 0d 0a 20 20 20 20 20 20 20 20 39 35 35 20 42 |).. 955 B| 00001e00 3d 41 2b 31 35 32 34 0d 0a 20 20 20 20 20 20 20 |=A+1524.. | 00001e10 20 39 36 30 20 43 3d 49 4e 54 28 28 42 2f 33 36 | 960 C=INT((B/36| 00001e20 35 2e 32 35 29 2d 30 2e 33 33 34 33 29 0d 0a 20 |5.25)-0.3343).. | 00001e30 20 20 20 20 20 20 20 39 36 35 20 44 3d 49 4e 54 | 965 D=INT| 00001e40 28 33 36 35 2e 32 35 2a 43 29 0d 0a 20 20 20 20 |(365.25*C).. | 00001e50 20 20 20 20 39 37 30 20 45 3d 49 4e 54 28 28 42 | 970 E=INT((B| 00001e60 2d 44 29 2f 33 30 2e 36 31 29 0d 0a 20 20 20 20 |-D)/30.61).. | 00001e70 20 20 20 20 39 37 35 20 44 3d 42 2d 44 2d 49 4e | 975 D=B-D-IN| 00001e80 54 28 33 30 2e 36 31 2a 45 29 2b 46 0d 0a 20 20 |T(30.61*E)+F.. | 00001e90 20 20 20 20 20 20 39 38 30 20 4d 3d 45 2d 31 3a | 980 M=E-1:| 00001ea0 20 59 3d 43 2d 34 37 31 36 0d 0a 20 20 20 20 20 | Y=C-4716.. | 00001eb0 20 20 20 39 38 35 20 49 46 20 45 3e 31 33 2e 35 | 985 IF E>13.5| 00001ec0 20 54 48 45 4e 20 4d 3d 4d 2d 31 32 0d 0a 20 20 | THEN M=M-12.. | 00001ed0 20 20 20 20 20 20 39 39 30 20 49 46 20 4d 3c 32 | 990 IF M<2| 00001ee0 2e 35 20 54 48 45 4e 20 59 3d 59 2b 31 0d 0a 20 |.5 THEN Y=Y+1.. | 00001ef0 20 20 20 20 20 20 20 39 39 35 20 50 52 49 4e 54 | 995 PRINT| 00001f00 20 22 44 41 54 45 3a 20 22 3b 59 3b 4d 3b 44 0d | "DATE: ";Y;M;D.| 00001f10 0a 20 20 20 20 20 20 20 20 39 39 37 20 45 4e 44 |. 997 END| 00001f20 0d 0a 0d 0a 20 20 20 20 20 20 20 20 4e 6f 74 65 |.... Note| 00001f30 20 6f 6e 20 76 61 72 69 61 74 69 6f 6e 73 3a 20 | on variations: | 00001f40 20 57 69 74 68 20 52 61 64 69 6f 20 53 68 61 63 | With Radio Shac| 00001f50 6b 20 4c 65 76 65 6c 20 49 49 20 42 61 73 69 63 |k Level II Basic| 00001f60 2c 20 72 65 70 6c 61 63 65 20 4a 0d 0a 20 20 20 |, replace J.. | 00001f70 20 20 20 20 20 69 6e 20 6c 69 6e 65 20 38 37 30 | in line 870| 00001f80 20 77 69 74 68 20 43 44 42 4c 28 4a 29 2e 20 20 | with CDBL(J). | 00001f90 49 6e 20 41 70 70 6c 65 73 6f 66 74 2c 20 75 73 |In Applesoft, us| 00001fa0 65 20 63 6f 6d 6d 61 73 20 72 61 74 68 65 72 20 |e commas rather | 00001fb0 74 68 61 6e 0d 0a 20 20 20 20 20 20 20 20 73 65 |than.. se| 00001fc0 6d 69 63 6f 6c 6f 6e 73 20 69 6e 20 6c 69 6e 65 |micolons in line| 00001fd0 73 20 38 37 30 20 61 6e 64 20 39 39 35 2e 20 20 |s 870 and 995. | 00001fe0 53 6f 6d 65 20 42 61 73 69 63 73 20 72 65 71 75 |Some Basics requ| 00001ff0 69 72 65 20 61 20 62 61 63 6b 2d 0d 0a 20 20 20 |ire a back-.. | 00002000 20 20 20 20 20 73 6c 61 73 68 20 77 68 65 72 65 | slash where| 00002010 20 63 6f 6c 6f 6e 73 20 61 72 65 20 75 73 65 64 | colons are used| 00002020 20 68 65 72 65 2e 0d 0a 0d 0a 0d 0a 20 20 20 20 | here....... | 00002030 20 20 20 20 41 73 74 72 6f 6e 6f 6d 69 63 61 6c | Astronomical| 00002040 20 43 6f 6d 70 75 74 69 6e 67 20 20 20 20 20 20 | Computing | 00002050 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002060 20 20 20 20 20 20 20 20 20 50 61 67 65 20 33 20 | Page 3 | 00002070 6f 66 20 36 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a |of 6............| 00002080 20 20 20 20 20 20 20 20 20 20 20 20 20 4c 69 73 | Lis| 00002090 74 69 6e 67 20 32 20 70 65 72 66 6f 72 6d 73 20 |ting 2 performs | 000020a0 74 68 65 20 69 6e 76 65 72 73 65 20 63 61 6c 63 |the inverse calc| 000020b0 75 6c 61 74 69 6f 6e 2e 20 20 49 6e 69 74 69 61 |ulation. Initia| 000020c0 6c 6c 79 2c 20 4a 0d 0a 20 20 20 20 20 20 20 20 |lly, J.. | 000020d0 69 73 20 74 68 65 20 4a 75 6c 69 61 6e 20 44 61 |is the Julian Da| 000020e0 79 20 6e 75 6d 62 65 72 2c 20 61 6e 64 20 46 20 |y number, and F | 000020f0 74 68 65 20 66 72 61 63 74 69 6f 6e 61 6c 20 70 |the fractional p| 00002100 61 72 74 20 6f 66 20 61 20 64 61 79 2e 0d 0a 20 |art of a day... | 00002110 20 20 20 20 20 20 20 57 68 65 6e 20 74 68 65 20 | When the | 00002120 70 72 6f 67 72 61 6d 20 66 69 6e 69 73 68 65 73 |program finishes| 00002130 2c 20 59 20 69 73 20 74 68 65 20 79 65 61 72 2c |, Y is the year,| 00002140 20 4d 20 74 68 65 20 6d 6f 6e 74 68 2c 20 61 6e | M the month, an| 00002150 64 20 44 20 74 68 65 0d 0a 20 20 20 20 20 20 20 |d D the.. | 00002160 20 64 61 79 20 28 77 69 74 68 20 66 72 61 63 74 | day (with fract| 00002170 69 6f 6e 29 2e 20 20 54 68 69 73 20 70 72 6f 67 |ion). This prog| 00002180 72 61 6d 20 69 73 20 62 61 73 65 64 20 6f 6e 20 |ram is based on | 00002190 74 68 65 20 61 6c 67 6f 72 69 74 68 6d 20 69 6e |the algorithm in| 000021a0 0d 0a 20 20 20 20 20 20 20 20 4a 65 61 6e 20 4d |.. Jean M| 000021b0 65 65 75 73 27 73 20 41 73 74 72 6f 6e 6f 6d 69 |eeus's Astronomi| 000021c0 63 61 6c 20 46 6f 72 6d 75 6c 61 65 20 66 6f 72 |cal Formulae for| 000021d0 20 43 61 6c 63 75 6c 61 74 6f 72 73 20 28 57 69 | Calculators (Wi| 000021e0 6c 6c 6d 61 6e 6e 2d 0d 0a 20 20 20 20 20 20 20 |llmann-.. | 000021f0 20 42 65 6c 6c 2c 20 31 39 38 32 29 2c 20 77 69 | Bell, 1982), wi| 00002200 74 68 20 73 6f 6d 65 20 72 65 61 72 72 61 6e 67 |th some rearrang| 00002210 65 6d 65 6e 74 20 74 6f 20 73 75 69 74 20 74 68 |ement to suit th| 00002220 65 20 6d 61 6e 79 20 6d 69 63 72 6f 2d 0d 0a 20 |e many micro-.. | 00002230 20 20 20 20 20 20 20 63 6f 6d 70 75 74 65 72 73 | computers| 00002240 20 77 69 74 68 20 6f 6e 6c 79 20 73 65 76 65 6e | with only seven| 00002250 20 64 69 67 69 74 20 61 63 63 75 72 61 63 79 2e | digit accuracy.| 00002260 20 20 48 65 72 65 20 61 67 61 69 6e 2c 20 47 0d | Here again, G.| 00002270 0a 20 20 20 20 20 20 20 20 64 65 74 65 72 6d 69 |. determi| 00002280 6e 65 73 20 74 68 65 20 63 61 6c 65 6e 64 61 72 |nes the calendar| 00002290 20 73 74 79 6c 65 2e 20 20 28 54 68 65 20 4d 65 | style. (The Me| 000022a0 65 75 73 20 62 6f 6f 6b 20 61 6c 73 6f 20 64 65 |eus book also de| 000022b0 73 63 72 69 62 65 73 0d 0a 20 20 20 20 20 20 20 |scribes.. | 000022c0 20 74 68 65 20 69 6e 76 65 72 73 65 20 63 61 6c | the inverse cal| 000022d0 63 75 6c 61 74 69 6f 6e 2c 20 62 79 20 61 20 6d |culation, by a m| 000022e0 65 74 68 6f 64 20 64 69 66 66 65 72 65 6e 74 20 |ethod different | 000022f0 66 72 6f 6d 20 74 68 61 74 0d 0a 20 20 20 20 20 |from that.. | 00002300 20 20 20 64 65 73 63 72 69 62 65 64 20 68 65 72 | described her| 00002310 65 20 62 75 74 20 69 64 65 6e 74 69 63 61 6c 20 |e but identical | 00002320 69 6e 20 72 65 73 75 6c 74 2e 29 0d 0a 0d 0a 20 |in result.).... | 00002330 20 20 20 20 20 20 20 20 20 20 20 20 46 6f 72 20 | For | 00002340 65 78 61 6d 70 6c 65 2c 20 63 6f 6e 73 69 64 65 |example, conside| 00002350 72 20 74 68 65 20 67 65 6f 63 65 6e 74 72 69 63 |r the geocentric| 00002360 20 63 6f 6e 6a 75 6e 63 74 69 6f 6e 20 6f 66 20 | conjunction of | 00002370 74 68 65 20 53 75 6e 0d 0a 20 20 20 20 20 20 20 |the Sun.. | 00002380 20 61 6e 64 20 4d 6f 6f 6e 20 74 68 69 73 20 6d | and Moon this m| 00002390 6f 6e 74 68 2e 20 20 49 74 20 6f 63 63 75 72 73 |onth. It occurs| 000023a0 20 61 74 20 31 36 3a 35 32 3a 33 39 20 55 54 20 | at 16:52:39 UT | 000023b0 6f 6e 20 4d 61 79 20 33 30 74 68 2c 20 73 6f 0d |on May 30th, so.| 000023c0 0a 20 20 20 20 20 20 20 20 74 68 65 20 64 61 79 |. the day| 000023d0 20 69 73 20 65 78 70 72 65 73 73 65 64 20 64 65 | is expressed de| 000023e0 63 69 6d 61 6c 6c 79 20 61 73 20 33 30 2e 37 30 |cimally as 30.70| 000023f0 33 32 33 20 61 6e 64 20 74 68 65 20 64 69 61 6c |323 and the dial| 00002400 6f 67 75 65 20 72 75 6e 73 3a 0d 0a 0d 0a 20 20 |ogue runs:.... | 00002410 20 20 20 20 20 20 20 20 20 3e 52 55 4e 20 22 43 | >RUN "C| 00002420 41 4c 4a 44 22 0d 0a 20 20 20 20 20 20 20 20 20 |ALJD".. | 00002430 20 20 59 2c 4d 2c 44 20 3f 20 31 39 38 34 2c 20 | Y,M,D ? 1984, | 00002440 35 2c 20 33 30 2e 37 30 33 32 33 0d 0a 20 20 20 |5, 30.70323.. | 00002450 20 20 20 20 20 20 20 20 4a 43 20 28 30 29 20 4f | JC (0) O| 00002460 52 20 47 43 20 28 31 29 20 3f 20 31 0d 0a 20 20 |R GC (1) ? 1.. | 00002470 20 20 20 20 20 20 20 20 20 4a 2e 44 2e 3a 20 20 | J.D.: | 00002480 32 34 34 35 38 35 31 20 2e 32 30 33 32 33 0d 0a |2445851 .20323..| 00002490 20 20 20 20 20 20 20 20 20 20 20 52 45 41 44 59 | READY| 000024a0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 3e |.... >| 000024b0 52 55 4e 20 22 4a 44 43 41 4c 22 0d 0a 20 20 20 |RUN "JDCAL".. | 000024c0 20 20 20 20 20 20 20 20 4a 2c 46 20 3f 20 32 34 | J,F ? 24| 000024d0 34 35 38 35 31 2c 20 2e 32 30 33 32 33 0d 0a 20 |45851, .20323.. | 000024e0 20 20 20 20 20 20 20 20 20 20 4a 43 20 28 30 29 | JC (0)| 000024f0 20 4f 52 20 47 43 20 28 31 29 20 3f 20 31 0d 0a | OR GC (1) ? 1..| 00002500 20 20 20 20 20 20 20 20 20 20 20 44 41 54 45 3a | DATE:| 00002510 20 20 31 39 38 34 20 20 35 20 20 33 30 2e 37 30 | 1984 5 30.70| 00002520 33 32 33 0d 0a 20 20 20 20 20 20 20 20 20 20 20 |323.. | 00002530 52 45 41 44 59 0d 0a 0d 0a 20 20 20 20 20 20 20 |READY.... | 00002540 20 20 20 20 20 20 46 75 74 75 72 65 20 70 72 6f | Future pro| 00002550 67 72 61 6d 20 6c 69 73 74 69 6e 67 73 20 69 6e |gram listings in| 00002560 20 74 68 69 73 20 64 65 70 61 72 74 6d 65 6e 74 | this department| 00002570 20 77 69 6c 6c 20 6f 66 74 65 6e 20 6d 61 6b 65 | will often make| 00002580 0d 0a 20 20 20 20 20 20 20 20 75 73 65 20 6f 66 |.. use of| 00002590 20 74 68 65 20 4a 75 6c 69 61 6e 20 44 61 79 20 | the Julian Day | 000025a0 6e 75 6d 62 65 72 20 61 6e 64 20 66 72 61 63 74 |number and fract| 000025b0 69 6f 6e 2c 20 73 6f 20 72 65 61 64 65 72 73 20 |ion, so readers | 000025c0 6d 61 79 20 77 69 73 68 0d 0a 20 20 20 20 20 20 |may wish.. | 000025d0 20 20 74 6f 20 72 65 77 72 69 74 65 20 74 68 65 | to rewrite the| 000025e0 73 65 20 6c 69 73 74 69 6e 67 73 20 61 73 20 73 |se listings as s| 000025f0 75 62 72 6f 75 74 69 6e 65 73 2e 20 20 41 66 74 |ubroutines. Aft| 00002600 65 72 20 72 65 70 6c 61 63 69 6e 67 20 65 61 63 |er replacing eac| 00002610 68 0d 0a 20 20 20 20 20 20 20 20 45 4e 44 20 73 |h.. END s| 00002620 74 61 74 65 6d 65 6e 74 20 77 69 74 68 20 52 45 |tatement with RE| 00002630 54 55 52 4e 2c 20 79 6f 75 20 63 61 6e 20 73 69 |TURN, you can si| 00002640 6d 70 6c 79 20 69 6e 73 65 72 74 20 74 68 65 6d |mply insert them| 00002650 20 62 6f 64 69 6c 79 0d 0a 20 20 20 20 20 20 20 | bodily.. | 00002660 20 69 6e 74 6f 20 6f 74 68 65 72 20 70 72 6f 67 | into other prog| 00002670 72 61 6d 73 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 |rams..... | 00002680 20 20 20 20 20 20 42 6f 74 68 20 6c 69 73 74 69 | Both listi| 00002690 6e 67 73 20 68 61 76 65 20 62 65 65 6e 20 74 68 |ngs have been th| 000026a0 6f 72 6f 75 67 68 6c 79 20 74 65 73 74 65 64 20 |oroughly tested | 000026b0 61 74 20 53 6b 79 20 26 0d 0a 20 20 20 20 20 20 |at Sky &.. | 000026c0 20 20 54 65 6c 65 73 63 6f 70 65 20 6f 6e 20 6d | Telescope on m| 000026d0 61 6e 79 20 6d 69 63 72 6f 63 6f 6d 70 75 74 65 |any microcompute| 000026e0 72 73 2c 20 66 6f 72 20 74 68 65 20 79 65 61 72 |rs, for the year| 000026f0 73 20 2d 34 37 31 32 20 74 68 72 6f 75 67 68 20 |s -4712 through | 00002700 74 6f 0d 0a 20 20 20 20 20 20 20 20 2b 33 35 30 |to.. +350| 00002710 30 20 69 6e 20 62 6f 74 68 20 74 68 65 20 47 72 |0 in both the Gr| 00002720 65 67 6f 72 69 61 6e 20 61 6e 64 20 4a 75 6c 69 |egorian and Juli| 00002730 61 6e 20 63 61 6c 65 6e 64 61 72 73 2e 20 20 42 |an calendars. B| 00002740 75 74 20 69 74 27 73 0d 0a 20 20 20 20 20 20 20 |ut it's.. | 00002750 20 77 69 73 65 2c 20 77 68 65 6e 20 74 72 79 69 | wise, when tryi| 00002760 6e 67 20 6f 75 74 20 74 68 65 20 70 72 6f 67 72 |ng out the progr| 00002770 61 6d 73 20 6f 6e 20 79 6f 75 72 20 6f 77 6e 20 |ams on your own | 00002780 6d 61 63 68 69 6e 65 2c 20 74 6f 0d 0a 20 20 20 |machine, to.. | 00002790 20 20 20 20 20 76 65 72 69 66 79 20 74 68 65 20 | verify the | 000027a0 72 65 73 75 6c 74 73 20 6f 6e 20 73 6f 6d 65 20 |results on some | 000027b0 6b 6e 6f 77 6e 20 65 71 75 69 76 61 6c 65 6e 74 |known equivalent| 000027c0 73 3a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 |s:.... | 000027d0 20 20 20 20 4a 75 6c 69 61 6e 20 43 61 6c 2e 20 | Julian Cal. | 000027e0 20 20 20 20 20 20 20 20 47 72 65 67 6f 72 69 61 | Gregoria| 000027f0 6e 20 43 61 6c 2e 20 20 20 20 20 20 4a 75 6c 69 |n Cal. Juli| 00002800 61 6e 20 44 61 74 65 0d 0a 0d 0a 20 20 20 20 20 |an Date.... | 00002810 20 20 20 20 20 20 20 2d 34 37 31 32 20 4a 61 6e | -4712 Jan| 00002820 2e 20 20 31 2e 35 20 20 20 20 20 20 2d 34 37 31 |. 1.5 -471| 00002830 33 20 4e 6f 76 2e 20 32 34 2e 35 20 20 20 20 20 |3 Nov. 24.5 | 00002840 20 20 20 20 20 20 20 20 30 2e 30 0d 0a 20 20 20 | 0.0.. | 00002850 20 20 20 20 20 20 20 20 20 2d 32 30 30 30 20 4a | -2000 J| 00002860 61 6e 2e 20 20 31 2e 30 20 20 20 20 20 20 2d 32 |an. 1.0 -2| 00002870 30 30 31 20 44 65 63 2e 20 31 35 2e 30 20 20 20 |001 Dec. 15.0 | 00002880 20 20 20 20 20 39 39 30 35 35 37 2e 35 0d 0a 20 | 990557.5.. | 00002890 20 20 20 20 20 20 20 20 20 20 20 20 2d 35 38 34 | -584| 000028a0 20 4d 61 79 20 20 32 38 2e 36 20 20 20 20 20 20 | May 28.6 | 000028b0 20 2d 35 38 34 20 4d 61 79 20 20 32 32 2e 36 20 | -584 May 22.6 | 000028c0 20 20 20 20 20 20 31 35 30 37 39 30 30 2e 31 0d | 1507900.1.| 000028d0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 2b 32 |. +2| 000028e0 30 30 20 4d 61 72 2e 20 20 31 2e 30 20 20 20 20 |00 Mar. 1.0 | 000028f0 20 20 20 2b 32 30 30 20 4d 61 72 2e 20 20 31 2e | +200 Mar. 1.| 00002900 30 20 20 20 20 20 20 20 31 37 39 34 31 36 37 2e |0 1794167.| 00002910 35 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2b |5.. +| 00002920 31 39 38 34 20 46 65 62 2e 20 31 36 2e 32 20 20 |1984 Feb. 16.2 | 00002930 20 20 20 20 2b 31 39 38 34 20 46 65 62 2e 20 32 | +1984 Feb. 2| 00002940 39 2e 32 20 20 20 20 20 20 20 32 34 34 35 37 35 |9.2 244575| 00002950 39 2e 37 0d 0a 20 20 20 20 20 20 20 20 20 20 20 |9.7.. | 00002960 20 2b 31 39 39 39 20 44 65 63 2e 20 31 39 2e 35 | +1999 Dec. 19.5| 00002970 20 20 20 20 20 20 2b 32 30 30 30 20 4a 61 6e 2e | +2000 Jan.| 00002980 20 20 31 2e 35 20 20 20 20 20 20 20 32 34 35 31 | 1.5 2451| 00002990 35 34 35 2e 30 0d 0a 20 20 20 20 20 20 20 20 20 |545.0.. | 000029a0 20 20 20 2b 33 30 30 30 20 46 65 62 2e 20 32 39 | +3000 Feb. 29| 000029b0 2e 39 20 20 20 20 20 20 2b 33 30 30 30 20 4d 61 |.9 +3000 Ma| 000029c0 72 2e 20 32 31 2e 39 20 20 20 20 20 20 20 32 38 |r. 21.9 28| 000029d0 31 36 38 36 37 2e 34 0d 0a 0d 0a 20 20 20 20 20 |16867.4.... | 000029e0 20 20 20 20 20 20 20 20 4d 61 6e 79 20 61 6e 63 | Many anc| 000029f0 69 65 6e 74 20 63 61 6c 65 6e 64 61 72 73 20 68 |ient calendars h| 00002a00 61 76 65 20 62 65 65 6e 20 6c 69 6e 6b 65 64 20 |ave been linked | 00002a10 62 79 20 4a 75 6c 69 61 6e 20 44 61 79 0d 0a 20 |by Julian Day.. | 00002a20 20 20 20 20 20 20 20 6e 75 6d 62 65 72 20 69 6e | number in| 00002a30 20 4f 2e 4c 2e 48 61 72 76 65 79 27 73 20 6e 65 | O.L.Harvey's ne| 00002a40 77 20 62 6f 6f 6b 6c 65 74 2c 20 43 61 6c 65 6e |w booklet, Calen| 00002a50 64 61 72 20 43 6f 6e 76 65 72 73 69 6f 6e 73 0d |dar Conversions.| 00002a60 0a 20 20 20 20 20 20 20 20 28 41 6d 65 72 69 63 |. (Americ| 00002a70 61 6e 20 50 68 69 6c 6f 73 6f 70 68 69 63 61 6c |an Philosophical| 00002a80 20 53 6f 63 69 65 74 79 2c 20 31 39 38 33 29 2e | Society, 1983).| 00002a90 20 20 48 65 20 61 6c 73 6f 20 6d 65 6e 74 69 6f | He also mentio| 00002aa0 6e 73 20 74 77 6f 0d 0a 20 20 20 20 20 20 20 20 |ns two.. | 00002ab0 75 73 65 66 75 6c 20 74 72 69 63 6b 73 20 77 69 |useful tricks wi| 00002ac0 74 68 20 74 68 65 73 65 20 6e 75 6d 62 65 72 73 |th these numbers| 00002ad0 2e 20 20 54 6f 20 66 69 6e 64 20 74 68 65 20 64 |. To find the d| 00002ae0 61 79 20 6f 66 20 74 68 65 20 77 65 65 6b 0d 0a |ay of the week..| 00002af0 20 20 20 20 20 20 20 20 61 74 20 6e 6f 6f 6e 20 | at noon | 00002b00 77 68 65 6e 20 65 61 63 68 20 4a 75 6c 69 61 6e |when each Julian| 00002b10 20 44 61 79 20 6e 75 6d 62 65 72 20 62 65 67 69 | Day number begi| 00002b20 6e 73 2c 20 64 69 76 69 64 65 20 74 68 65 20 77 |ns, divide the w| 00002b30 68 6f 6c 65 0d 0a 20 20 20 20 20 20 20 20 6e 75 |hole.. nu| 00002b40 6d 62 65 72 20 62 79 20 37 3b 20 61 20 72 65 6d |mber by 7; a rem| 00002b50 61 69 6e 64 65 72 20 6f 66 20 30 20 6d 65 61 6e |ainder of 0 mean| 00002b60 73 20 4d 6f 6e 64 61 79 2c 20 31 20 54 75 65 73 |s Monday, 1 Tues| 00002b70 64 61 79 2c 20 61 6e 64 20 73 6f 0d 0a 20 20 20 |day, and so.. | 00002b80 20 20 20 20 20 6f 6e 2c 20 74 68 72 6f 75 67 68 | on, through| 00002b90 20 74 6f 20 36 20 66 6f 72 20 53 75 6e 64 61 79 | to 6 for Sunday| 00002ba0 2e 20 20 46 75 72 74 68 65 72 6d 6f 72 65 2c 20 |. Furthermore, | 00002bb0 74 68 65 20 4d 6f 6f 6e 20 69 73 20 77 69 74 68 |the Moon is with| 00002bc0 69 6e 20 61 0d 0a 20 20 20 20 20 20 20 20 64 61 |in a.. da| 00002bd0 79 20 6f 72 20 73 6f 20 6f 66 20 6e 65 77 20 6f |y or so of new o| 00002be0 6e 20 74 68 6f 73 65 20 64 61 79 73 20 77 68 65 |n those days whe| 00002bf0 6e 20 74 68 65 20 4a 75 6c 69 61 6e 20 44 61 79 |n the Julian Day| 00002c00 20 6e 75 6d 62 65 72 2c 0d 0a 20 20 20 20 20 20 | number,.. | 00002c10 20 20 64 69 76 69 64 65 64 20 62 79 20 32 39 2e | divided by 29.| 00002c20 35 33 30 35 38 38 2c 20 79 69 65 6c 64 73 20 2e |530588, yields .| 00002c30 33 33 20 61 73 20 74 68 65 20 66 72 61 63 74 69 |33 as the fracti| 00002c40 6f 6e 61 6c 20 70 61 72 74 2e 0d 0a 0d 0a 0d 0a |onal part.......| 00002c50 20 20 20 20 20 20 20 20 41 73 74 72 6f 6e 6f 6d | Astronom| 00002c60 69 63 61 6c 20 43 6f 6d 70 75 74 69 6e 67 20 20 |ical Computing | 00002c70 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00002c80 20 20 20 20 20 20 20 20 20 20 20 20 20 50 61 67 | Pag| 00002c90 65 20 34 20 6f 66 20 36 0d 0a 0d 0a 0d 0a 0d 0a |e 4 of 6........| 00002ca0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 |.... | 00002cb0 20 50 72 69 6f 72 20 74 6f 20 31 39 32 35 2c 20 | Prior to 1925, | 00002cc0 61 73 74 72 6f 6e 6f 6d 65 72 73 20 61 63 74 75 |astronomers actu| 00002cd0 61 6c 6c 79 20 63 6f 6e 73 69 64 65 72 65 64 20 |ally considered | 00002ce0 65 61 63 68 20 6e 65 77 0d 0a 20 20 20 20 20 20 |each new.. | 00002cf0 20 20 63 61 6c 65 6e 64 61 72 20 64 61 74 65 20 | calendar date | 00002d00 74 6f 20 63 6f 6d 6d 65 6e 63 65 20 61 74 20 6e |to commence at n| 00002d10 6f 6f 6e 20 6f 6e 20 74 68 65 20 63 6f 72 72 65 |oon on the corre| 00002d20 73 70 6f 6e 64 69 6e 67 20 63 69 76 69 6c 0d 0a |sponding civil..| 00002d30 20 20 20 20 20 20 20 20 64 61 74 65 2e 20 20 42 | date. B| 00002d40 75 74 20 6f 75 72 20 70 72 6f 67 72 61 6d 73 20 |ut our programs | 00002d50 75 73 65 20 74 68 65 20 6d 6f 64 65 72 6e 20 63 |use the modern c| 00002d60 6f 6e 76 65 6e 74 69 6f 6e 20 61 73 20 74 6f 20 |onvention as to | 00002d70 77 68 65 6e 20 61 0d 0a 20 20 20 20 20 20 20 20 |when a.. | 00002d80 63 61 6c 65 6e 64 61 72 20 64 61 79 20 62 65 67 |calendar day beg| 00002d90 69 6e 73 2c 20 65 76 65 6e 20 66 6f 72 20 64 61 |ins, even for da| 00002da0 74 65 73 20 62 65 66 6f 72 65 20 31 39 32 35 2e |tes before 1925.| 00002db0 20 20 4e 65 76 65 72 74 68 65 6c 65 73 73 2c 0d | Nevertheless,.| 00002dc0 0a 20 20 20 20 20 20 20 20 69 74 20 69 73 20 77 |. it is w| 00002dd0 65 6c 6c 20 74 6f 20 72 65 6d 65 6d 62 65 72 20 |ell to remember | 00002de0 74 68 69 73 20 63 68 61 6e 67 65 20 69 6e 20 75 |this change in u| 00002df0 73 61 67 65 20 77 68 65 6e 20 63 6f 6e 73 75 6c |sage when consul| 00002e00 74 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 65 61 |ting.. ea| 00002e10 72 6c 79 20 61 73 74 72 6f 6e 6f 6d 69 63 61 6c |rly astronomical| 00002e20 20 73 6f 75 72 63 65 73 2e 0d 0a 0d 0a 20 20 20 | sources..... | 00002e30 20 20 20 20 20 20 20 20 20 20 41 6c 73 6f 20 62 | Also b| 00002e40 65 77 61 72 65 20 74 68 65 20 22 4d 6f 64 69 66 |eware the "Modif| 00002e50 69 65 64 20 4a 75 6c 69 61 6e 20 44 61 74 65 22 |ied Julian Date"| 00002e60 20 28 4d 4a 44 29 2c 20 64 65 66 69 6e 65 64 20 | (MJD), defined | 00002e70 61 73 0d 0a 20 20 20 20 20 20 20 20 74 68 65 20 |as.. the | 00002e80 74 72 75 65 20 4a 44 20 6d 69 6e 75 73 20 32 2c |true JD minus 2,| 00002e90 34 30 30 2c 30 30 30 2e 35 2c 20 61 6e 64 20 73 |400,000.5, and s| 00002ea0 6f 6d 65 74 69 6d 65 73 20 61 64 76 6f 63 61 74 |ometimes advocat| 00002eb0 65 64 20 74 6f 20 68 65 6c 70 0d 0a 20 20 20 20 |ed to help.. | 00002ec0 20 20 20 20 70 72 65 73 65 72 76 65 20 64 69 67 | preserve dig| 00002ed0 69 74 73 20 69 6e 20 6d 61 63 68 69 6e 65 73 20 |its in machines | 00002ee0 6f 66 20 6c 69 6d 69 74 65 64 20 70 72 65 63 69 |of limited preci| 00002ef0 73 69 6f 6e 2e 20 20 49 6e 20 72 65 61 6c 69 74 |sion. In realit| 00002f00 79 2c 0d 0a 20 20 20 20 20 20 20 20 73 69 6e 63 |y,.. sinc| 00002f10 65 20 74 68 65 20 66 69 72 73 74 20 74 77 6f 20 |e the first two | 00002f20 64 69 67 69 74 73 20 6f 66 20 74 68 65 20 4a 44 |digits of the JD| 00002f30 20 68 61 76 65 20 62 65 65 6e 20 32 34 20 6f 6e | have been 24 on| 00002f40 6c 79 20 73 69 6e 63 65 0d 0a 20 20 20 20 20 20 |ly since.. | 00002f50 20 20 31 38 35 39 2c 20 74 68 65 20 64 65 76 69 | 1859, the devi| 00002f60 63 65 20 69 73 20 75 73 65 66 75 6c 20 6f 6e 6c |ce is useful onl| 00002f70 79 20 66 72 6f 6d 20 61 20 6e 61 72 72 6f 77 20 |y from a narrow | 00002f80 6d 6f 64 65 72 6e 0d 0a 20 20 20 20 20 20 20 20 |modern.. | 00002f90 70 65 72 73 70 65 63 74 69 76 65 2e 20 20 4d 6f |perspective. Mo| 00002fa0 72 65 20 61 6c 61 72 6d 69 6e 67 2c 20 74 68 6f |re alarming, tho| 00002fb0 75 67 68 2c 20 69 73 20 74 68 65 20 64 61 6e 67 |ugh, is the dang| 00002fc0 65 72 20 6f 66 20 63 6f 6e 66 75 73 69 6f 6e 0d |er of confusion.| 00002fd0 0a 20 20 20 20 20 20 20 20 69 6e 74 72 6f 64 75 |. introdu| 00002fe0 63 65 64 20 62 79 20 74 68 65 20 2e 35 20 28 69 |ced by the .5 (i| 00002ff0 6e 74 65 6e 64 65 64 20 74 6f 20 6d 61 6b 65 20 |ntended to make | 00003000 74 68 65 20 4d 4a 44 20 62 65 67 69 6e 20 77 68 |the MJD begin wh| 00003010 65 6e 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 |en the.. | 00003020 63 69 76 69 6c 20 64 61 79 20 64 6f 65 73 29 2e |civil day does).| 00003030 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 |.... | 00003040 20 54 68 65 20 63 6f 65 78 69 73 74 65 6e 63 65 | The coexistence| 00003050 20 6f 66 20 74 68 69 73 20 77 69 74 68 20 61 6e | of this with an| 00003060 6f 74 68 65 72 20 63 6f 6d 6d 6f 6e 20 64 65 76 |other common dev| 00003070 69 63 65 2c 20 74 68 61 74 20 6f 66 0d 0a 20 20 |ice, that of.. | 00003080 20 20 20 20 20 20 73 69 6d 70 6c 79 20 6c 6f 70 | simply lop| 00003090 70 69 6e 67 20 6f 66 66 20 74 68 65 20 68 69 67 |ping off the hig| 000030a0 68 65 73 74 20 66 65 77 20 64 69 67 69 74 73 20 |hest few digits | 000030b0 6f 66 20 74 68 65 20 4a 44 2c 20 68 61 73 20 6f |of the JD, has o| 000030c0 66 74 65 6e 0d 0a 20 20 20 20 20 20 20 20 6c 65 |ften.. le| 000030d0 64 20 74 6f 20 61 20 63 6f 6e 66 75 73 69 6f 6e |d to a confusion| 000030e0 20 6f 66 20 31 32 20 68 6f 75 72 73 20 69 6e 20 | of 12 hours in | 000030f0 74 68 65 20 61 73 74 72 6f 6e 6f 6d 69 63 61 6c |the astronomical| 00003100 20 6c 69 74 65 72 61 74 75 72 65 2e 0d 0a 20 20 | literature... | 00003110 20 20 20 20 20 20 54 68 65 20 70 72 61 63 74 69 | The practi| 00003120 63 65 20 6f 66 20 61 64 6a 75 73 74 69 6e 67 20 |ce of adjusting | 00003130 74 68 65 20 4a 44 20 62 79 20 73 6f 6d 65 20 63 |the JD by some c| 00003140 6f 6e 73 74 61 6e 74 20 77 61 73 20 6f 6e 63 65 |onstant was once| 00003150 0d 0a 20 20 20 20 20 20 20 20 64 65 73 63 72 69 |.. descri| 00003160 62 65 64 20 62 79 20 74 68 65 20 6c 61 74 65 20 |bed by the late | 00003170 50 61 75 6c 20 48 65 72 67 65 74 20 61 73 20 22 |Paul Herget as "| 00003180 61 6e 20 61 74 74 65 6d 70 74 20 74 6f 20 70 65 |an attempt to pe| 00003190 72 76 65 72 74 20 74 68 65 0d 0a 20 20 20 20 20 |rvert the.. | 000031a0 20 20 20 65 73 74 61 62 6c 69 73 68 65 64 20 73 | established s| 000031b0 79 73 74 65 6d 22 20 6f 66 20 61 73 74 72 6f 6e |ystem" of astron| 000031c0 6f 6d 69 63 61 6c 20 72 65 63 6b 6f 6e 69 6e 67 |omical reckoning| 000031d0 2e 20 20 46 61 72 20 62 65 74 74 65 72 20 6e 6f |. Far better no| 000031e0 74 0d 0a 20 20 20 20 20 20 20 20 74 6f 20 74 69 |t.. to ti| 000031f0 6e 6b 65 72 20 77 69 74 68 20 69 74 2c 20 61 6e |nker with it, an| 00003200 64 20 6c 65 74 20 6f 75 72 20 6d 61 63 68 69 6e |d let our machin| 00003210 65 73 20 77 6f 72 72 79 20 61 62 6f 75 74 20 74 |es worry about t| 00003220 68 65 20 64 65 74 61 69 6c 73 21 0d 0a 0d 0a 20 |he details!.... | 00003230 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | * 00003260 20 20 20 20 20 20 20 52 4f 47 45 52 20 57 2e 20 | ROGER W. | 00003270 53 49 4e 4e 4f 54 54 0d 0a 0d 0a 20 20 20 20 20 |SINNOTT.... | 00003280 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003290 20 20 20 20 20 20 20 20 20 20 20 20 2d 2d 2d 2d | ----| 000032a0 2d 6f 4f 6f 2d 2d 2d 2d 2d 0d 0a 0d 0a 0d 0a 20 |-oOo-----...... | 000032b0 20 20 20 20 20 20 20 46 72 6f 6d 20 74 68 65 20 | From the | 000032c0 53 65 70 74 65 6d 62 65 72 20 31 39 38 34 20 69 |September 1984 i| 000032d0 73 73 75 65 20 6f 66 20 53 6b 79 20 26 20 54 65 |ssue of Sky & Te| 000032e0 6c 65 73 63 6f 70 65 2c 20 70 61 67 65 20 32 35 |lescope, page 25| 000032f0 35 2e 2e 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 |5....... | 00003300 20 20 20 20 20 4d 69 6c 6f 20 4c 2e 20 48 75 72 | Milo L. Hur| 00003310 6c 65 79 2c 20 4a 72 2e 2c 20 6f 66 20 41 75 72 |ley, Jr., of Aur| 00003320 6f 72 61 2c 20 43 6f 6c 6f 72 61 64 6f 2c 20 77 |ora, Colorado, w| 00003330 72 69 74 65 73 20 74 68 61 74 20 6f 75 72 0d 0a |rites that our..| 00003340 20 20 20 20 20 20 20 20 70 72 6f 67 72 61 6d 20 | program | 00003350 66 6f 72 20 63 6f 6d 70 75 74 69 6e 67 20 74 68 |for computing th| 00003360 65 20 4a 75 6c 69 61 6e 20 64 61 74 65 20 66 72 |e Julian date fr| 00003370 6f 6d 20 74 68 65 20 63 61 6c 65 6e 64 61 72 20 |om the calendar | 00003380 64 61 74 65 0d 0a 20 20 20 20 20 20 20 20 28 4c |date.. (L| 00003390 69 73 74 69 6e 67 20 31 20 69 6e 20 74 68 65 20 |isting 1 in the | 000033a0 4d 61 79 20 69 73 73 75 65 2c 20 70 61 67 65 20 |May issue, page | 000033b0 34 35 35 29 20 64 6f 65 73 20 6e 6f 74 20 72 75 |455) does not ru| 000033c0 6e 20 70 72 6f 70 65 72 6c 79 20 66 6f 72 0d 0a |n properly for..| 000033d0 20 20 20 20 20 20 20 20 6e 65 67 61 74 69 76 65 | negative| 000033e0 20 79 65 61 72 73 20 77 68 65 6e 20 77 72 69 74 | years when writ| 000033f0 74 65 6e 20 69 6e 20 44 69 67 69 74 61 6c 20 52 |ten in Digital R| 00003400 65 73 65 61 72 63 68 27 73 20 43 42 41 53 49 43 |esearch's CBASIC| 00003410 20 66 6f 72 20 68 69 73 0d 0a 20 20 20 20 20 20 | for his.. | 00003420 20 20 41 6c 74 6f 73 20 63 6f 6d 70 75 74 65 72 | Altos computer| 00003430 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 |..... | 00003440 20 20 48 65 20 68 61 73 20 74 72 61 63 65 64 20 | He has traced | 00003450 74 68 65 20 70 72 6f 62 6c 65 6d 20 74 6f 20 74 |the problem to t| 00003460 68 65 20 49 4e 54 20 66 75 6e 63 74 69 6f 6e 2c |he INT function,| 00003470 20 77 68 69 63 68 20 74 61 6b 65 73 0d 0a 20 20 | which takes.. | 00003480 20 20 20 20 20 20 74 68 65 20 69 6e 74 65 67 65 | the intege| 00003490 72 20 70 61 72 74 20 6f 66 20 61 20 6e 75 6d 62 |r part of a numb| 000034a0 65 72 2e 20 20 49 6e 20 43 42 41 53 49 43 20 28 |er. In CBASIC (| 000034b0 61 73 20 6f 6e 20 6d 61 6e 79 20 70 6f 63 6b 65 |as on many pocke| 000034c0 74 0d 0a 20 20 20 20 20 20 20 20 63 61 6c 63 75 |t.. calcu| 000034d0 6c 61 74 6f 72 73 29 2c 20 74 68 65 20 69 6e 74 |lators), the int| 000034e0 65 67 65 72 20 70 61 72 74 20 6f 66 20 61 20 6e |eger part of a n| 000034f0 65 67 61 74 69 76 65 20 6e 75 6d 62 65 72 20 69 |egative number i| 00003500 73 20 6f 62 74 61 69 6e 65 64 0d 0a 20 20 20 20 |s obtained.. | 00003510 20 20 20 20 62 79 20 74 72 75 6e 63 61 74 69 6e | by truncatin| 00003520 67 20 74 68 65 20 64 65 63 69 6d 61 6c 20 70 61 |g the decimal pa| 00003530 72 74 3b 20 74 68 75 73 2c 20 62 6f 74 68 20 28 |rt; thus, both (| 00003540 49 4e 54 2d 33 2e 32 29 20 61 6e 64 0d 0a 20 20 |INT-3.2) and.. | 00003550 20 20 20 20 20 20 49 4e 54 28 2d 33 2e 38 29 20 | INT(-3.8) | 00003560 79 69 65 6c 64 20 2d 33 2e 20 20 49 6e 20 61 6c |yield -3. In al| 00003570 6c 20 74 68 65 20 6f 74 68 65 72 20 6d 69 63 72 |l the other micr| 00003580 6f 63 6f 6d 70 75 74 65 72 20 42 61 73 69 63 73 |ocomputer Basics| 00003590 20 77 65 27 76 65 0d 0a 20 20 20 20 20 20 20 20 | we've.. | 000035a0 74 72 69 65 64 2c 20 74 68 65 20 61 6e 73 77 65 |tried, the answe| 000035b0 72 20 69 73 20 2d 34 20 69 6e 20 74 68 65 73 65 |r is -4 in these| 000035c0 20 74 77 6f 20 63 61 73 65 73 2e 20 20 41 20 72 | two cases. A r| 000035d0 65 6d 65 64 79 20 69 6e 20 43 42 41 53 49 43 0d |emedy in CBASIC.| 000035e0 0a 20 20 20 20 20 20 20 20 69 73 20 74 6f 20 73 |. is to s| 000035f0 65 74 20 75 70 20 61 20 75 73 65 72 2d 64 65 66 |et up a user-def| 00003600 69 6e 65 64 20 66 75 6e 63 74 69 6f 6e 20 74 68 |ined function th| 00003610 61 74 20 6d 69 6d 69 63 73 20 42 61 73 69 63 73 |at mimics Basics| 00003620 20 6f 66 20 74 68 65 0d 0a 20 20 20 20 20 20 20 | of the.. | 00003630 20 6f 74 68 65 72 20 74 79 70 65 2c 20 61 6e 64 | other type, and| 00003640 20 74 6f 20 73 75 62 73 74 69 74 75 74 65 20 74 | to substitute t| 00003650 68 69 73 20 66 6f 72 20 49 4e 54 20 74 68 72 6f |his for INT thro| 00003660 75 67 68 6f 75 74 20 74 68 65 0d 0a 20 20 20 20 |ughout the.. | 00003670 20 20 20 20 70 72 6f 67 72 61 6d 2e 0d 0a 0d 0a | program.....| 00003680 20 20 20 20 20 20 20 20 20 20 20 20 20 54 68 65 | The| 00003690 20 42 61 73 69 63 73 20 74 68 61 74 20 67 69 76 | Basics that giv| 000036a0 65 20 2d 34 20 61 70 70 65 61 72 20 74 6f 20 62 |e -4 appear to b| 000036b0 65 20 74 68 65 20 63 6c 65 61 72 20 6d 61 6a 6f |e the clear majo| 000036c0 72 69 74 79 2c 0d 0a 20 20 20 20 20 20 20 20 61 |rity,.. a| 000036d0 6e 64 20 77 69 74 68 20 74 68 65 6d 20 74 68 65 |nd with them the| 000036e0 20 63 61 6c 65 6e 64 61 72 20 70 72 6f 67 72 61 | calendar progra| 000036f0 6d 20 77 6f 72 6b 73 20 77 69 74 68 6f 75 74 20 |m works without | 00003700 6d 6f 64 69 66 69 63 61 74 69 6f 6e 2e 0d 0a 20 |modification... | 00003710 20 20 20 20 20 20 20 54 68 65 73 65 20 69 6e 63 | These inc| 00003720 6c 75 64 65 20 74 68 65 20 4d 69 63 72 6f 73 6f |lude the Microso| 00003730 66 74 20 76 65 72 73 69 6f 6e 73 20 72 75 6e 6e |ft versions runn| 00003740 69 6e 67 20 6f 6e 20 74 68 65 20 41 70 70 6c 65 |ing on the Apple| 00003750 2c 20 52 61 64 69 6f 0d 0a 20 20 20 20 20 20 20 |, Radio.. | 00003760 20 53 68 61 63 6b 2c 20 61 6e 64 20 4f 68 69 6f | Shack, and Ohio| 00003770 20 53 63 69 65 6e 74 69 66 69 63 20 6d 61 63 68 | Scientific mach| 00003780 69 6e 65 73 2c 20 61 6e 64 20 61 6c 73 6f 20 4e |ines, and also N| 00003790 6f 72 74 68 20 53 74 61 72 2c 0d 0a 20 20 20 20 |orth Star,.. | 000037a0 20 20 20 20 44 69 67 69 74 61 6c 20 45 71 75 69 | Digital Equi| 000037b0 70 6d 65 6e 74 2c 20 61 6e 64 20 48 65 77 6c 65 |pment, and Hewle| 000037c0 74 74 2d 50 61 63 6b 61 72 64 20 42 61 73 69 63 |tt-Packard Basic| 000037d0 73 2e 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 |s....... | 000037e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 000037f0 20 20 20 20 20 20 20 20 20 2d 2d 2d 2d 2d 6f 4f | -----oO| 00003800 6f 2d 2d 2d 2d 2d 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a |o-----..........| 00003810 0d 0a 20 20 20 20 20 20 20 20 41 73 74 72 6f 6e |.. Astron| 00003820 6f 6d 69 63 61 6c 20 43 6f 6d 70 75 74 69 6e 67 |omical Computing| 00003830 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003840 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 50 | P| 00003850 61 67 65 20 35 20 6f 66 20 36 0d 0a 0d 0a 0d 0a |age 5 of 6......| 00003860 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 20 20 45 6c |...... El| 00003870 65 63 74 72 6f 6e 69 63 20 4e 65 77 73 20 53 65 |ectronic News Se| 00003880 72 76 69 63 65 0d 0a 0d 0a 20 20 20 20 20 20 20 |rvice.... | 00003890 20 20 20 20 20 20 43 6f 6d 70 75 74 65 72 20 6f | Computer o| 000038a0 77 6e 65 72 73 20 77 69 74 68 20 6d 6f 64 65 6d |wners with modem| 000038b0 73 20 63 61 6e 20 6f 62 74 61 69 6e 20 66 61 73 |s can obtain fas| 000038c0 74 20 6e 65 77 73 20 66 72 6f 6d 20 53 6b 79 20 |t news from Sky | 000038d0 26 0d 0a 20 20 20 20 20 20 20 20 54 65 6c 65 73 |&.. Teles| 000038e0 63 6f 70 65 20 6f 66 20 63 6f 6d 65 74 20 61 6e |cope of comet an| 000038f0 64 20 6e 6f 76 61 20 64 69 73 63 6f 76 65 72 69 |d nova discoveri| 00003900 65 73 2c 20 61 6e 64 20 61 6c 73 6f 20 70 72 6f |es, and also pro| 00003910 67 72 61 6d 0d 0a 20 20 20 20 20 20 20 20 6c 69 |gram.. li| 00003920 73 74 69 6e 67 73 20 66 72 6f 6d 20 74 68 65 20 |stings from the | 00003930 41 73 74 72 6f 6e 6f 6d 69 63 61 6c 20 43 6f 6d |Astronomical Com| 00003940 70 75 74 69 6e 67 20 44 65 70 61 72 74 6d 65 6e |puting Departmen| 00003950 74 2e 20 20 41 66 74 65 72 0d 0a 20 20 20 20 20 |t. After.. | 00003960 20 20 20 6a 6f 69 6e 69 6e 67 20 43 6f 6d 70 75 | joining Compu| 00003970 53 65 72 76 65 20 28 74 68 72 6f 75 67 68 20 61 |Serve (through a| 00003980 20 6c 6f 63 61 6c 20 52 61 64 69 6f 20 53 68 61 | local Radio Sha| 00003990 63 6b 20 6f 72 20 63 6f 6d 70 75 74 65 72 0d 0a |ck or computer..| 000039a0 20 20 20 20 20 20 20 20 64 65 61 6c 65 72 29 2c | dealer),| 000039b0 20 6c 6f 67 20 6f 6e 20 61 6e 64 20 6d 6f 76 65 | log on and move| 000039c0 20 74 6f 20 50 65 72 73 6f 6e 61 6c 20 43 6f 6d | to Personal Com| 000039d0 70 75 74 69 6e 67 20 61 6e 64 20 74 68 65 6e 20 |puting and then | 000039e0 74 68 65 0d 0a 20 20 20 20 20 20 20 20 50 65 72 |the.. Per| 000039f0 73 6f 6e 61 6c 20 46 69 6c 65 20 41 72 65 61 2e |sonal File Area.| 00003a00 20 20 4f 6e 63 65 20 74 68 65 72 65 2c 20 61 74 | Once there, at| 00003a10 20 61 6e 79 20 6d 65 6e 75 2c 20 74 79 70 65 20 | any menu, type | 00003a20 52 20 41 43 43 45 53 53 0d 0a 20 20 20 20 20 20 |R ACCESS.. | 00003a30 20 20 54 68 65 6e 20 61 74 20 74 68 65 20 6e 65 | Then at the ne| 00003a40 78 74 20 6d 65 6e 75 20 74 79 70 65 20 52 20 4e |xt menu type R N| 00003a50 45 57 53 2e 44 41 54 5b 37 30 32 37 35 2c 31 32 |EWS.DAT[70275,12| 00003a60 35 5d 20 74 6f 20 72 65 63 65 69 76 65 20 74 68 |5] to receive th| 00003a70 69 73 0d 0a 20 20 20 20 20 20 20 20 73 65 72 76 |is.. serv| 00003a80 69 63 65 2e 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a |ice.............| 00003a90 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a |................| * 00003ae0 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a 20 20 20 20 20 20 |.......... | 00003af0 20 20 41 73 74 72 6f 6e 6f 6d 69 63 61 6c 20 43 | Astronomical C| 00003b00 6f 6d 70 75 74 69 6e 67 20 20 20 20 20 20 20 20 |omputing | 00003b10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | | 00003b20 20 20 20 20 20 20 20 50 61 67 65 20 36 20 6f 66 | Page 6 of| 00003b30 20 36 0d 0a 0d 0a 0d 0a 0d 0a 0d 0a | 6..........| 00003b3c