gnucobol-users
[Top][All Lists]
Advanced

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

RE: [open-cobol-list] Cobol Precision


From: Bill Klein
Subject: RE: [open-cobol-list] Cobol Precision
Date: Thu May 26 17:17:34 2005

When "ARITHMETIC IS STANDARD" (new in the '02 Standard) is in effect, then
there are rules (designed) to produce "portable and predictable" results for
SOME - but not all - arithmetic statements and expressions.

The "SIDI" (Standard Intermediate Data Item) is a "conceptual" data item
used for intermediate results.  This is a >>>DECIMAL<<< type
"floating-point" (not Binary, not Hex, not anything like what most people
are used to today) AND it isn't even a "data-type" that is required to exist
in COBOL itself (from a user perspective).

Truncation and precision is done in Decimal (not binary) Floating Point.

There is a discussion of all of this - including examples of how this works
in
  "E.16 Standard arithmetic"
starting on page 763 of '02 Standard.

   ****

However, you might also want to look at a proposal included in the current
revision work for the '08 Standard.  Check out:

  http://www.cobolportal.com/j4/files/05-0047.doc

IEEE is working on creating a "new" decimal floating point data type
(actually 3 different ones) and these MAY be easier to use in COBOL (as an
intermediate data type) when/if available on various hardware/software
platforms.

   ****

Does this actually answer you question?  If not, can you help me understand
it better?

NOTE WELL:
  In both the '02 Standard and the draft revision, the DEFAULT remains
"arithmetic is native" - so the implementor can do anything they want
(including truncating every operand and intermediate data item to integers
<G> - although I don't think that would be very popular).

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden On 
> Behalf Of Roger While
> Sent: Thursday, May 26, 2005 5:37 PM
> To: Bill Klein
> Cc: address@hidden
> Subject: [open-cobol-list] Cobol Precision
> 
> Clarification required :
> 8.8.1.3.1.1 Precision and allowable magnitude
> A standard intermediate data item has the unique value of 
> zero or a value 
> whose magnitude is in the range of
> 10-999 (1.000 000 000 000 000 000 000 000 000 000 0E-999)
> through
> 101000 - 10968 (9.999 999 999 999 999 999 999 999 999 999 9E+999)
> inclusive, with a precision of 32 decimal digits. A standard 
> intermediate 
> data item shall be truncated or rounded
> to fewer than 32 digits only as explicitly specified.
> 
> What exactly does this mean ?
> 
> Roger
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by Yahoo.
> Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
> Search APIs Find out how you can build Yahoo! directly into your own
> Applications - visit 
> http://developer.yahoo.net/?fr=fad-ysdn-ostg-q22005
> _______________________________________________
> 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]