Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!tektronix!psueea!jove.cs.pdx.edu!warren From: warren@jove.cs.pdx.edu (Warren Harrison) Newsgroups: comp.software-eng Subject: Floating Point in COBOL Message-ID: <1137@psueea.UUCP> Date: 5 May 89 01:24:35 GMT Sender: news@psueea.UUCP Reply-To: warren@jove.cs.pdx.edu (Warren Harrison) Organization: Dept. of Computer Science, Portland State University; Portland OR Lines: 31 Perhaps this is stretching a point since after checking, I found out this is an IBM extension to the ANSI-78 standard, but COMP-1 and COMP-2 are single and double word floating point data types, aligned on fullword and doubleword boundaries, respectively. Computational is fixed point. True, COMP-3 (packed decimal) is limited to 36 characters, but I know of no other language which provides this much accuracy (remember, this stuff is stored in base 10, so round off errors are significantly reduced) in a data type. 36 decimal places is: 999999999999999999999999999999999999. Please note that I didn't suggest COBOL was an all purpose programming language, but that modular programs could be written at least as easy in it as in most other langauges, and much easier than in many other languages. The overhead of a COBOL subprogram call is probably less than the overhead of a Pascal call since local variables do not have to be generated each time (data items within the subprogram are static), thus you have less of a performance ding against subprogram calls than in many other "modular" langauges. I know of many non-commercial applications that have been written in COBOL. For example I have been told that Micro Focus COBOL/2 is written in COBOL. I myself have written a COBOL subset compiler in COBOL (and Pascal compilers in Pascal - I failed to see much difference once you're familiar with the language). So far, no operating systems or flight control software though :-) Warren Warren Harrison CSNET: warren@pdx.edu Department of Computer Science UUCP: {ucbvax,decvax}!tektronix!psu-cs!warren Portland State University Internet: warren%pdx.edu@relay.cs.net Portland, OR 97207-0751