Caculations above 2.1 billion

Spiderman

New Member
Hi, we have Progress vers 8.2B character based on a Solaris platform.
I am failing to do calculations with values (decimal) above 2 billion approx.
It gives wrong results eg
2,000,000,000 + 1,000,000,000 = -1,294,967,296.
Tks.
 

DevTeam

Member
Hi,

According to the online KB :

"The Progress DECIMAL data type may have up to 50 digits in length including up to 10 digits to the right of the decimal point.
The range of a Progress INTEGER value is limited from -2,147,483,648 to 2,147,483,647."

Considering this, there should be no problem for what you do. But Progress seems to "cast" the 2 numbers into INTEGER, making the final value crash...

whereas if you do this :
Code:
DEF VAR t AS DECIMAL NO-UNDO.
t = 2000000000.0 + 1000000000.0.
DISP STRING(t) FORMAT "x(70)".

it works....
 

Spiderman

New Member
Thanks. This is great....:)

Hi,

According to the online KB :

"The Progress DECIMAL data type may have up to 50 digits in length including up to 10 digits to the right of the decimal point.
The range of a Progress INTEGER value is limited from -2,147,483,648 to 2,147,483,647."

Considering this, there should be no problem for what you do. But Progress seems to "cast" the 2 numbers into INTEGER, making the final value crash...

whereas if you do this :
Code:
DEF VAR t AS DECIMAL NO-UNDO.
t = 2000000000.0 + 1000000000.0.
DISP STRING(t) FORMAT "x(70)".

it works....
 

tamhas

ProgressTalk.com Sponsor
Alternatively, you could upgrade to a reasonably modern version of Progress and get 64 bit integers. :)
 

tamhas

ProgressTalk.com Sponsor
If you are on maintenance, the upgrade is free.

And no. I really like the company, especially in recent years, but it has never been an exciting stock.
 
Top