Kbase P119368: INT64 data type set to max value rolls over to negative number when 1 is added
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  2/16/2009 |
|
Status: Verified
SYMPTOM(s):
Program sets INTEGER variable to its maximum value
Program adds 1 to INTEGER variable and properly gets error 13682
Program sets INT64 to its maximum value
Program adds 1 to INT64 variable and no error happens, value rolls to a negative number
Value 2147483648 too large to fit in INTEGER datatype. (13682)
** Value <value> cannot be displayed using <format>. (74)
FACT(s) (Environment):
OpenEdge 10.1B1B
CAUSE:
Prior to OpenEdge 10.1B, When we used to have only 32 bits, we were similarily unable to check for 32 bit overflow. Now that we have 64bits we can start checking for 32bit overflow for the first time in OpenEdge 10.1B.
Overflow for INT64 cannot be checked for because there are only 64 bits to work with. When the value goes beyond +-2^63 it will simply overflow and become negative/positive depending on the amount it overflows.
Checking for 64bit overflow would be too expensive. To do it would require putting everything in 128 bits to do calculations and then to copy it all back, since >64bits are required to do 64bit overflow checking. This would cause all arithmetic in the 4gl to grind to a halt. There are therefore no plans to implement this checking.
FIX:
Product behaving as designed.