gnucobol-users
[Top][All Lists]
Advanced

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

Re: [open-cobol-list] [Bulk] Posible difference in the precision of COMP


From: Brian Tiffin
Subject: Re: [open-cobol-list] [Bulk] Posible difference in the precision of COMPUTE statements between OPEN COBOL 1.1 and mainframe COBOL
Date: Fri, 26 Feb 2010 00:07:58 -0500
User-agent: KMail/1.9.9

As far as I know   ROUNDED  is NEAREST-AWAY-FROM-ZERO, and I get a calculator 
result of

2177.705416666666667  so isn't  .71 the proper round up?

002177.70 is the result for no ROUNDED clause, the default "rounding" being 
trunctation.  No?

I'm looking at Annex C of the  July 2009 Draft.  I'm not 100% on these specs, 
but I'd wager that OpenCOBOL is right on this one,  and it's the other 
compiler that needs a beat down.  :)

Cheers,
Brian

On February 25, 2010 12:27:04 pm Wolfgang Westphal wrote:
> 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




reply via email to

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