>No,
>
>The error was only dividing the last digit of the year by 4 to determine
>if it was a leap year.  I.e. 92 is divisible by 4 but 2 is not.
>

There must be plenty of ways of going wrong.

However, the ones I recall were taking a two or four digit BCD year number, 
and testing if it was divisible by four as if it was a binary number. For 
example, 
in assembler, using a TM instruction to check if the low order two bits were 
both zero. By that method, or by actually doing a binary divide, X'1980' or 
X'80' is correctly determined to be a leap year. It continues to work correctly 
up to 1989 but since X'1990' or X'90' is divisible by four, 1990 is taken as a 
leap. X'1992' or X'92' is not divisible by four, ergo 1992 is not a leap year 
... 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to