gnucobol-users
[Top][All Lists]
Advanced

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

Re: [open-cobol-list] Posible difference in the precision of COMPUTE sta


From: Michael
Subject: Re: [open-cobol-list] Posible difference in the precision of COMPUTE statements between OPEN COBOL 1.1 and mainframe COBOL
Date: Fri, 26 Feb 2010 02:24:31 -0600
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Not that it helps or answers any question, but: I've used Open Cobol, Fujitsu Cobol, MicroFocus Cobol, Acu Cobol, Kobol, and HP Cobol-II, and each have their own small differences and rounding has been a issue moving from one compiler to another. It was the root cause of a bug I chased down last month going from HP Cobol the AcuCobol. What I've started doing lately is to use DIVIDE with REMAINDER, and then ADD 1 or not depending on the value of the REMAINDER. That way I know that the results will be the same on other compilers, plus it will give you the ability to force a specific precision based on the value of the remainder.

FWIW: OpenCobol is a great thing for the Cobol community, and I hope that one day Open Cobol will set the standard for other Cobol compilers to follow!

Mike.

Wolfgang Westphal wrote:
Hello,

The following example gives different results in OPEN COBOL 1.1 and
mainframe COBOL:

01  RESULT-1 PIC 9(6).99.
    COMPUTE RESULT-1 ROUNDED = 46956.93 / 24 + 5308.00 / 24
    DISPLAY RESULT-1

OPEN COBOL displays 002177.71
mainframe displays  002177.70

Do I make any mistake?
Could there be a fault in my installation?
Is this normal behaviour of OPEN COBOL?
Is there a posibility of forcing specific precision?

I am using OPEN COBOL 1.1 with WINDOWS XP.
For the installation I used a MINGW environment.

Regards
Wolfgang


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list



reply via email to

[Prev in Thread] Current Thread [Next in Thread]