gnucobol-users
[Top][All Lists]
Advanced

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

Re: [open-cobol-list] OpenCOBOL release 1.0


From: Tim Josling
Subject: Re: [open-cobol-list] OpenCOBOL release 1.0
Date: Sat, 29 Dec 2007 14:42:10 +1100

On Fri, 2007-12-28 at 11:27 +0100, Alain wrote:
> On Thu, 27 Dec 2007 13:13:17 -0500
> "Ron Norman" <address@hidden> wrote:
> 
> > A PIC S9(10) COMP is TOO BIG for a 32-bit integer.
> > The maximum you can use and still have it fit is PIC S9(9) COMP.
> > 
> 
> Hi Ron and Serguey,
> Thanks for your answer, but the documentation of C and postgres said that an 
> int may have the values from -2 147 483 648 to +2 147 483 647 ie 10 digits.
> In my remember, a cobol documentation said that the maximum value for PIC 
> S9(9), eventually COMP, is 999 999 999 so, if you are right, it is impossible 
> to have the value of an int.
> In fact, when the problem appears I have the fields defined as pic s9(8) 
> comp, so ??? 
> 
> -- 
> Alain <address@hidden>
> 
> 

-2 147 483 648  and +2 147 483 647 are not the largest possible
magnitide 10-digit numbers.

9,999,999,999 and -9,999,999,999 are 10 digit numbers which fit in pic
s9(10) but not in a 32-bit int.

So s9(10) comp *is* too big for int32. Though not all values you might
put there are necessarily too big.

Tim Josling



reply via email to

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