< previous page page_170 next page >

Page 170
subtracting or adding the appropriate number of days. A sample function to calculate the date of Collop Monday is:
#include "scdtl_2.h"
#include "scdtl_4.h"
struct DATE_INFO collop_monday (int year)
 {
    double jd;
    struct DATE_INFO date_1, date_2;
    date_1 = easter (year);
    jd = date_to_JD0 (&date_1);
    jd -= 48.0;
    date_2 = JD0_to_date (jd);
    return (date_2);
 }
Listing 6.22 easter_gauss ()
/* easter_q.c


   +-------------------------------------------+
   |   Copyright (C) 1995 by Lance W. Latham.  |
   |         All rights reserved.              |
   +-------------------------------------------+


   Routine implementing Gauss's Easter Sunday algorithm. This is a 'quick'
   routine, with limited input range.


   INPUTS:
   1. year, type int, the year in the Gregorian calendar for which the
      date of Easter is desired. Valid range is 1583 <= year <= 2199.


   OUTPUTS:
   1. Returned by routine, a DATE_INFO structure containing the date of
      Easter for the given year.


   NOTES:


   1. This routine is a modification from a COBOL source, as reported by
      Constance Veening, and supplied by Joao de Magalhaes.


   2. This date is the date of 'Western' Easter, not Easter in the
      tradition of the Eastern Church.


   3. The routine returns a date of all zeroes for input years outside
      the valid range. No other validation is performed, and no warning
      is issued in this case.
*/


 
< previous page page_170 next page >