comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Y2K Issues
Date: 1998/10/27
Date: 1998-10-27T00:00:00+00:00	[thread overview]
Message-ID: <F1I5z2.9K8.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 713oes$dbn$1@nnrp1.dejanews.com

dewarr@my-dejanews.com wrote:

: In article <7125a8$e7u$1@nnrp1.dejanews.com>,
:   dennison@telepath.com wrote:
: > In article <710nnc$jop@felix.seas.gwu.edu>,


: > Don't be quite so hard on uSoft. ObjectAda 7.1.1 had this exact same problem.

That surprises me, because the package Calendar we have shipped with
our Ada 95 front end since the beginning has the following leap_year
function (original comment included):

    function leap_year (the_year : year_number) return Boolean is
    -- This algorithm is good for 1901-2099 (LRM), but not beyond.
    begin
        return ((the_year rem 4) = 0);
    end leap_year;

: > I understand it has been fixed in the current release, though.

That's good.  Maybe there is an interesting story here (or perhaps
this whole thing is apocryphal?).

: The remarkable thing about this (quite common) leap year bug is that it is
: a great example of how a little knowledge can be a dangerous thing. Someone
: who knows nothing about century corrections will get things right, someone
: who knows how century corrections work will get things right, it is only
: someone who knows about century corrections, but does not know how they
: work who gets things wrong. 

Interestingly, we found a similar problem in the old Meridian front end, 
which was written in Pascal, which we licensed many moons ago for some
Ada 83 products.  The programmer went to some effort to correct for years 
that were a multiple of 100 and of 400, but ended up with it exactly wrong.  

Luckily, this was not in the Calendar package, but
rather in the code which printed the date on the listing.  The net
effect is that listings using compilers based on the Meridian front end
will print the wrong date from February 29th, 2000 to December 30th, 2000.
If I remember correctly, they did manage to self-correct by the time
2001 comes along, so January 1st, 2001 will be correct.  I don't know
what will happen on December 31st, 2000.  I suspect they will either
print January 0, 2001, or December 32, 2000.

: ...I have always assumed that one of the reasons
: for the range of years in Ada is precisely that you don't have to worry
: about century corrections :-)

So much for trying to simplify the problem...

: Robert Dewar

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA
An AverStar Company




  parent reply	other threads:[~1998-10-27  0:00 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-19  0:00 Y2K Issues John J Cupak Jr
1998-10-19  0:00 ` Niklas Holsti
1998-10-19  0:00 ` Tucker Taft
1998-10-19  0:00   ` Joe Gwinn
1998-10-20  0:00     ` Joe Gwinn
1998-10-19  0:00 ` dewar
     [not found] ` <362B8D2F.802F42E6@lmco.com>
1998-10-20  0:00   ` Robert I. Eachus
1998-10-22  0:00     ` Mark Bennison
1998-10-22  0:00       ` dennison
1998-10-23  0:00         ` Robert I. Eachus
1998-10-20  0:00   ` dennison
1998-10-23  0:00     ` Michael F Brenner
1998-10-25  0:00   ` Michael Feldman
1998-10-26  0:00     ` Robert A Duff
1998-10-26  0:00       ` Joel Seidman
1998-10-26  0:00         ` Y2K Issues - Warning Off-Topic Al Christians
1998-10-27  0:00       ` Y2K Issues dewarr
1998-10-26  0:00     ` dennison
1998-10-27  0:00       ` dewarr
1998-10-27  0:00         ` John Herro
1998-10-27  0:00         ` Tucker Taft [this message]
1998-10-27  0:00           ` Y2K Issues (well, not really...) Dave Wood
1998-10-28  0:00           ` Y2K Issues dennison
1998-10-28  0:00             ` Dave Wood
1998-10-27  0:00     ` dewarr
1998-10-29  0:00       ` system
1998-10-29  0:00         ` Al Christians
1998-11-02  0:00         ` Marin David Condic
1998-11-04  0:00           ` Robert I. Eachus
1998-11-05  0:00             ` dewarr
1998-11-06  0:00               ` Jerry van Dijk
1998-11-07  0:00                 ` dewarr
1998-11-06  0:00                   ` Al Christians
1998-11-08  0:00                     ` Jerry van Dijk
1998-11-08  0:00                       ` dewarr
1998-11-06  0:00               ` Robert I. Eachus
1998-10-27  0:00 ` Gautier de Montmollin
1998-10-28  0:00   ` dewar
1998-10-28  0:00     ` Gautier.DeMontmollin
1998-10-28  0:00       ` Jean-Pierre Rosen
1998-10-28  0:00         ` Robert I. Eachus
1998-10-29  0:00           ` Dale Stanbrough
1998-10-29  0:00             ` Samuel Mize
1998-10-29  0:00             ` Mark A Biggar
1998-10-29  0:00             ` Tucker Taft
1998-10-29  0:00               ` dewar
1998-10-29  0:00                 ` Tucker Taft
1998-10-30  0:00                   ` dennison
1998-10-31  0:00                     ` dewarr
1998-11-02  0:00                       ` dennison
1998-10-30  0:00                 ` Dale Stanbrough
1998-10-30  0:00                 ` Matthew Heaney
1998-10-31  0:00                   ` dewar
1998-10-28  0:00   ` Arthur Evans Jr
1998-10-28  0:00   ` adam
1998-10-28  0:00     ` Al Christians
1998-10-29  0:00     ` Samuel Mize
1998-11-04  0:00     ` Robert I. Eachus
1998-10-28  0:00   ` adam
1998-10-29  0:00     ` Gautier.DeMontmollin
  -- strict thread matches above, loose matches on Subject: below --
1998-10-23  0:00 Condic, Marin D.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox