gnucobol-users
[Top][All Lists]
Advanced

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

[open-cobol-list] Numeric field issue and mpz_add


From: Tim Nixon
Subject: [open-cobol-list] Numeric field issue and mpz_add
Date: Fri Jan 28 09:47:48 2005

Hello:
I have a situation: if there is a numeric PIC field of width 10 or more,
ie:05 Var7 PIC S9(3)V9(8)and it is about to overflow (for example: the
variable Var7 has the value 999.9 and we're adding 1) then the result is
still 999.9. If the field width is less than 10 digits total, then adding 1
in the example above yields 000.9.
It appears that this is related to the use of the mpz_add function.
Is there a way to avoid this? On the mainframe (IBM) adding 1 to 999.9
(assuming the whole number part is 3 digits wide) always yields 000.9 no
matter what the total field width is.

Thanks
Tim Nixon



reply via email to

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