TIP: Click on subject to list as thread! ANSI
echo: public_domain
to: rowan_crowe
from: Paul Edwards
date: 1996-01-22 23:18:54
subject: Leap years

r> Based on the above, I've written a C callable ASM function to decide whether 
r> it's a leap year. I'm sure it's been done zillions of times in C too, but 
r> here's my particular solution.

Here's the C code I have.  It is unattributed, so I will have
to dig up another version or write my own or something later
on...

#ifndef ISLEAP
#define ISLEAP
#define isleap(year) ((((year%4)==0) && ((year%100)!=0)) || ((year%400)==0))
#endif

BFN.  Paul.
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.