home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / bsd / 11866 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.1 KB

  1. Path: sparky!uunet!math.fu-berlin.de!ira.uka.de!Germany.EU.net!incom!orfeo!hotb.RoBIN.de!alvman.RoBIN.de!not-for-mail
  2. From: ah@alvman.RoBIN.de (Andreas Haakh)
  3. Newsgroups: comp.unix.bsd
  4. Subject: Re: problems with date
  5. Date: 25 Jan 1993 20:46:11 +0100
  6. Lines: 26
  7. Message-ID: <1k1g23INNor@alvman.RoBIN.de>
  8. References: <1iu2jsINN518@fbi-news.Informatik.Uni-Dortmund.DE> <1993Jan14.064517.7201@st.simbirsk.su> <1j4gfuINNpme@hrd769.brooks.af.mil> <1jhlsdINNno7@life.ai.mit.edu>
  9. NNTP-Posting-Host: localhost
  10.  
  11. mycroft@hal.gnu.ai.mit.edu (Charles Hannum) writes:
  12.  
  13.  
  14. >I don't understand the point of the loop in clock.c.  ...
  15.  
  16. I think the loop is no bad idea. It's easy to understand.
  17. It works fine if you change the 
  18.        if ( y % 4 ) ...
  19. to 
  20.        if ( (y+2) %4 ) ... 
  21.  
  22. >+ #define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0)
  23.  
  24. Your macro `isleap` is correct but amusing.
  25. The simple form
  26.  
  27. #define isleap(y) ((y%4)==0)
  28.  
  29. is good for the next 106 years.
  30.  
  31. Within this period clock.c will be rewritten several times for new
  32. HW and/or OSes :-))
  33.  
  34.                     Andreas
  35. -- 
  36. Andreas Haakh  --  ah@alvman.RoBIN.de
  37.