10-19-2007, 06:29 AM
[quote author=Smurfy link=topic=13132.msg153278#msg153278 date=1192745322]
[\quote]
The following code for determining a leap year is wrong.
  IF X MOD 400 = 0 OR (X MOD 100 = 0 OR X MOD 4 = 0) THEN
The code should be:
 ' If the year is evenly divisible by 4 and not divisible
 ' by 100, or if the year is evenly divisible by 400, then
 ' it's a leap year:
 IF (X MOD 4 = 0 AND X MOD 100 <> 0) OR (X MOD 400 = 0) THEN
Regards..... Moneo
[\quote]
The following code for determining a leap year is wrong.
  IF X MOD 400 = 0 OR (X MOD 100 = 0 OR X MOD 4 = 0) THEN
The code should be:
 ' If the year is evenly divisible by 4 and not divisible
 ' by 100, or if the year is evenly divisible by 400, then
 ' it's a leap year:
 IF (X MOD 4 = 0 AND X MOD 100 <> 0) OR (X MOD 400 = 0) THEN
Regards..... Moneo