Is/was 1400 a leap year?
Bert Freudenberg
bert at isg.cs.uni-magdeburg.de
Wed May 16 16:56:17 UTC 2001
On Wed, 16 May 2001, Jörn Eyrich wrote:
> John Hinsley wrote:
> >
> > Thanks for the responses, Peter and Jon. It looks like whoever wrote cal
> > may have used divide by 4 (as I did) rather than divide by 400.
>
> On my system, cal 1700 is a leap year (correct under Julian if I
> understand it correctly)
> On my system, cal 1800 is not (correct under Gregorian if I understand
> it correctly)
>
> And sure enough, if you look at
>
> ftp://ftp.de.netbsd.org/pub/NetBSD/NetBSD-current/src/usr.bin/cal/cal.c
> you see
> /* leap year -- account for gregorian reformation in 1752 */
> #define leap_year(yr) \
> ((yr) <= 1752 ? !((yr) % 4) : \
> (!((yr) % 4) && ((yr) % 100)) || !((yr) % 400))
>
> where 1752 is the correct date probably only for the British Empire.
Right. In "cal 9 1752" you see that September 2nd was followed by
September 14:
September 1752
Su Mo Tu We Th Fr Sa
1 2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
The manual explains:
The Gregorian Reformation is assumed to have occurred in 1752 on the 3rd
of September. By this time, most countries had recognized the reforma
tion (although a few did not recognize it until the early 1900's.) Ten
days following that date were eliminated by the reformation, so the cal
endar for that month is a bit unusual.
-- Bert
More information about the Squeak-dev
mailing list
|