[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNU-COBOL] Math L:ibrary Incremental approach



>> Glen:
>>If we are writing Cobol (as opposed to something that looks like Cobol)
all
>>memory should be allocated at compile time.  The only run-time allocation

>  Chad:
>yes, we are aware of this. But in order to make development easier adn go
>faster. We are choosing to use dynamic memory at this time. This is
>a rather complex problem, that will be addressed in time, just not right
now.
>
>Software is best developed incrementally . And as brook's said you are
going to
>write it twice so plan for it. This is the first iteration of the math
>library. We plan to get it working, adn had the math semantics first,
>then address the memory problem later.


I believe in an incremental approach to program development.  I can't think
of a program that I have written that didn't start out as a long list of
stub subroutines and a generic main section.  I'm not smart enough to debug
a large program using any other approach.

One of the points that I am trying to make here is that the purpose for the
math library is to manipulate the memory - not to perform the math (in fact,
this is the principal purpose of Cobol - memory manipulation).  In Cobol,
the math takes place on the memory as it is defined in Working Storage.
Defining the math and then trying to fit it to the memory is where past
implementations have failed.

As much as I like Cobol, I will be the first to admit that Cobol math is
bizarre.  Intermediate storage areas are defined in the format of the
destination field, resulting in truncation/rounding errors in intermediate
steps.  While this would be considered a major design error in a modern
compiler, I have worked on many Cobol programs that depend on this happening
(strange eh?).  Just last month, a program was implemented in my shop that
depended on this intermediate truncation to strip a seventh character from a
transaction number to separate EDI transactions from journal voucher entries
made on-line.

We need to do what we can to write the libraries using Cobol memory types
and bit level arithmetic.  I sure hate to see Matt invest the time and
effort to do it twice.  Actually, there is a lot more to be learned by
writing low level math routines than by simply calling a C library.

Glen



--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to gnu-cobol@acm.cs.umr.edu with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@acm.cs.umr.edu.