HP3000-L Archives

November 1997, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Friedrich Harasleben <[log in to unmask]>
Reply To:
Friedrich Harasleben <[log in to unmask]>
Date:
Thu, 13 Nov 1997 08:50:35 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (50 lines)
Klaus Franke wrote:
> 
> Hi,
> 
> a nice routine, i found in some of our old c-sources:
> 
> #define leap_year(yy)    ((yy & 3) == 0 ? 1 : 0)
> 
>        Klaus Franke

???? Seemīs as if you still have not solved your y2k problem.

We are using the following C-code within our date-routines (it is not for the C-purists - but is easy to 
read for everyone, who has ever done some coding).

/* == FUNKTIONEN ======================================== */
int sjahr(int nJahr)
{
   int nRest = 0;

   if ((nRest =  nJahr % 4 ) != 0) {
        return( FALSE );
   }
   else {
        if (( nRest = nJahr % 100 ) == 0) {
             if (( nRest = nJahr % 400 ) == 0) {
                  return( TRUE );
             }
             else {
                  return( FALSE );
             }
        }
        else {
             return( TRUE );
        }
   }
}

Cheers,

friedrich 
_________________________________________________________________________________

     _/_/_/_/  _/_/_/_/ _/   _/ _/    _/   Oesterreichische Kreditversicherung AG
    _/    _/  _/       _/ _/    _/   _/    Friedrich Harasleben 
   _/    _/  _/_/_/   _/_/      _/  _/     e-mail: [log in to unmask]
  _/    _/  _/       _/  _/     _/ _/      fax   : +43 1 51554 50 300
 _/_/_/_/  _/_/_/_/ _/    _/    _/_/       phone : +43 1 51554 300
_________________________________________________________________________________

ATOM RSS1 RSS2