FreeBSD/usr.bin/calendar/ostern.c
/*
 * This code is based on the Calendar FAQ's code for how to calculate
 * easter is. This is the Gregorian calendar version. They refer to
 * the Algorithm of Oudin in the "Explanatory Supplement to the
 * Astronomical Almanac".
 */
This code is based on the Calendar FAQ's code for how to calculate
easter is. This is the Gregorian calendar version. They refer to
the Algorithm of Oudin in the "Explanatory Supplement to the
Astronomical Almanac".
This code is based on the Calendar FAQ ' s code for how to calculate easter is . This is the Gregorian calendar version . They refer to the Algorithm of Oudin in the " Explanatory Supplement to the Astronomical Almanac " .
int
easter(int year) 
{
	int G,	
	    C,	
	    H,	
	    I,	
	    J,	
	    L;	
	G = year % 19;
	C = year / 100;
	H = (C - C / 4 - (8 * C + 13) / 25 + 19 * G + 15) % 30;
	I = H - (H / 28) * (1 - (H / 28) * (29 / (H + 1)) * ((21 - G) / 11));
	J = (year + year / 4 + I + 2 - C + C / 4) % 7;
	L = I - J;
	if (isleap(year))
		return 31 + 29 + 21 + L + 7;
	else
		return 31 + 28 + 21 + L + 7;
}
int easter ( int year ) { int G , C , H , I , J , L ; G = year % 19 ; C = year / 100 ; H = ( C - C / 4 - ( 8 * C + 13 ) / 25 + 19 * G + 15 ) % 30 ; I = H - ( H / 28 ) * ( 1 - ( H / 28 ) * ( 29 / ( H + 1 ) ) * ( ( 21 - G ) / 11 ) ) ; J = ( year + year / 4 + I + 2 - C + C / 4 ) % 7 ; L = I - J ; if ( isleap ( year ) ) return 31 + 29 + 21 + L + 7 ; else return 31 + 28 + 21 + L + 7 ; }
This code is based on the Calendar FAQ's code for how to calculate
 easter is.
This code is based on the Calendar FAQ ' s code for how to calculate easter is .
/* 0 ... abcd, NOT since 1900 */ /* Golden number - 1 */ /* Century */ /* 23 - epact % 30 */ /* days from 21 March to Paschal full moon */ /* weekday of full moon */ /* days from 21 March to Sunday on of before full moon */