Tracy Pierce writes:
> beating this into the ground, I should say the prior version
_compiles_.
> this version even 'works' at least for cursory tests:
[snip]
The only concern I want to repeat is about the following assertions:
-----cut here-----
and ( d2ccyy / 4 * 4 = d2ccyy )
and not ( d2ccyy / 100 * 100 = d2ccyy )
* *d1 is a leap year (unless d2ccyy/400*400=d2ccyy)
* *the leapyear tests aren't perfect, but the
* *integer divisibility tests work great -
* *the quotient is integer-resolved via truncation
* *before the multiply happens, so division
* *precision is irrelevant.
-----cut here-----
This technique for testing for divisibility may work with the current
release of HP COBOL II/iX. Do not expect it to work for all releases of
all COBOL compilers.
With a little extra work, one can code a test for divisibility that will
work for all standard-conforming COBOL compilers.
Walter
Walter J. Murray
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *