From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_40,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b1850e397df49d95 X-Google-Attributes: gid103376,public From: Steve Jones - JON Subject: Re: How to convert an Fixed_Point to to an Integer ? Date: 1996/12/30 Message-ID: <2safqwb3jc.fsf@hpodid2.eurocontrol.fr>#1/1 X-Deja-AN: 206742936 references: <01bbf058$cbdbf980$LocalHost@jerryware> organization: Eurocontrol Experimental Centre, Bretigny-Sur-Orge, France newsgroups: comp.lang.ada Date: 1996-12-30T00:00:00+00:00 List-Id: Mike Young writes: > > Norman H. Cohen wrote: > > > > -- Note: This package works from the beginning of 1970 until the end > > of > > -- 2099, after which the package Ada.Calendar is no longer usable. > > -- During this period, a year y is a leap year if and only if y > > mod 4 = 0. > > ====== > I believe the year 2000 is *not* a leap year. I recall vaguely they skip > a leap year every 200 years, such that it's a leap year if the number is > evenly divisible by 4 and not by 200. You may want to verify this before > casting this in code. The net result is to cause all calc's spanning > 2/28/2000 to be reported incorrectly. Most specifically, > Previous_Leap_Years needs to be adjusted down one for dates beyond > 2/28/2000. > > Mike. Each century is not a leap year (eg 1900 wasn't) but Millenia ARE leap years so 2000 will be one. This has nicely made writting calendar progs a little simpler as you don't have to do a /100 check for a limited span product (eg 1970 -> 2099). I'd guess he stops at 2099 for just that reason. The check is quite simple but why add code when a comment suffices ? -- ---------------------------------------------------------------------------- Steve Jones | "Atticus says that carring a gun is a sure Eurocontrol Experimental Centre | way to get shot" -- Scout Finch in | To Kill a Mocking Bird by Harper Lee ---------------------------------------------------------------------------- Do not add me to any commercial mailing lists, all unsolicted commercial email will be billed at my current rate. ----------------------------------------------------------------------------