HP3000-L Archives

February 2006, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Walter Murray <[log in to unmask]>
Reply To:
Walter Murray <[log in to unmask]>
Date:
Thu, 9 Feb 2006 23:54:03 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (36 lines)
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 *

ATOM RSS1 RSS2