[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: |
Wed Jun 1 12:43:35 2005 |
Roger,
I am not certain why you talk about "1000 decimal". The actual '02
definition only requires 32 digit *plus* "exponent" precision. As far as a
library to "do this" goes, you might want to check out:
http://www2.hursley.ibm.com/decimal/#decNumber
("The decNumber package, an arbitrary-precision implementation of the
specifications in ANSI C, provides a reference implementation for the
arithmetic and encoding")
> -----Original Message-----
> From: Roger While [mailto:address@hidden
> Sent: Friday, May 27, 2005 4:08 AM
> To: Bill Klein
> Cc: address@hidden
> Subject: RE: [open-cobol-list] Cobol Precision
>
> OK. Thanks for the info. I overlooked E.16.
> Although it is still not clear to me what this reference to
> 1000 decimal
> places is. (wonders if the gmp library would be able to handle that)
>
> Roger
>
> At 19:14 26.05.2005 -0500, you wrote:
> >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 ?
>
>
>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- RE: [open-cobol-list] Cobol Precision,
Bill Klein <=