tailieunhanh - Preliminaries part 3

if (julian = IGREG) { Cross-over to Gregorian Calendar produces this correcjalpha=(long)(((float) (julian-1867216))/); tion. ja=julian+1+jalpha-(long) (*jalpha); } else if (julian | Some C Conventions for Scientific Computing 15 if julian IGREG Cross-over to Gregorian Calendar produces this correc-jalpha long float julian-1867216 tion. ja julian 1 jalpha- long jalpha else if julian 0 Make day number positive by adding integer number of ja julian 36525 1-julian 36525 Julian centuries then subtract them off else at the end. ja julian jb ja 1524 jc long float jb-2439870 jd long 365 jc jc je long jb-jd id jb-jd- long je mm je-1 if mm 12 mm - 12 iyyy jc-4715 if mm 2 iyyy if iyyy 0 -- iyyy if julian 0 iyyy - 100 1-julian 36525 For additional calendrical algorithms applicable to various historical calendars see 8 . CITED REFERENCES AND FURTHER READING Harbison . and Steele . Jr. 1991 C A Reference Manual 3rd ed. Englewood Cliffs NJ Prentice-Hall . Kernighan . 1978 The Elements of Programming Style New York McGraw-Hill . 1 Yourdon E. 1975 Techniques ofProgram Structure andDesign Englewood Cliffs NJ Prentice- Hall . 2 Jones R. and Stewart I. 1987 The ArtofCProgramming New York Springer-Verlag . 3 Hoare . 1981 Communications of the ACM vol. 24 pp. 75-83. Wirth N. 1983 Programming in Modula-2 3rd ed. New York Springer-Verlag . 4 Stroustrup B. 1986 The C Programming Language Reading MA Addison-Wesley . 5 Borland International Inc. 1989 Turbo Pascal Object-Oriented Programming Guide Scotts Valley CA Borland International . 6 Meeus J. 1982 Astronomical Formulae for Calculators 2nd ed. revised and enlarged Richmond VA Willmann-Bell . 7 Hatcher . 1984 Quarterly Journal ofthe RoyalAstronomical Society vol. 25 pp. 53-55 see also op. cit. 1985 vol. 26 pp. 151-155 and 1986 vol. 27 pp. 506-507. 8 Some C Conventions for Scientific Computing The C language was devised originally for systems programming work not for scientific computing. Relative to other high-level programming languages C puts the programmer very close to the machine in several respects. It is operator-rich .