suitcase

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

caldate_ster.c (456B)


      1 #include <tai/caldate.h>
      2 
      3 void caldate_easter(struct caldate *cd)
      4 {
      5   long c;
      6   long t;
      7   long j;
      8   long n;
      9   long y;
     10 
     11   y = cd->year;
     12 
     13   c = (y / 100) + 1;
     14   t = 210 - (((c * 3) / 4) % 210);
     15   j = y % 19;
     16   n = 57 - ((14 + j * 11 + (c * 8 + 5) / 25 + t) % 30);
     17   if ((n == 56) && (j > 10)) --n;
     18   if (n == 57) --n;
     19   n -= ((((y % 28) * 5) / 4 + t + n + 2) % 7);
     20 
     21   if (n < 32) { cd->month = 3; cd->day = n; }
     22   else { cd->month = 4; cd->day = n - 31; }
     23 }