[Info-vax] DCL Integer Overflow
Arne Vajhøj
arne at vajhoej.dk
Mon Jul 3 20:01:59 EDT 2017
On 7/3/2017 1:31 PM, Bob Koehler wrote:
> In article <5ae4986d-0da2-4457-b02d-057beff36d2b at googlegroups.com>, GerMarsh <marsh.family at tirhir.com> writes:
>> I know that there have been a few discussions about enhancing/replacing DCL, but I wonder if someone will fix the old integer overflow which has been there since the year dot...
>>
>> $ int=%x7fffffff
>> $ sho sym int
>> INT = 2147483647 Hex = 7FFFFFFF Octal = 17777777777
>> $ int=int+1
>> $ sho sym int
>> INT = -2147483648 Hex = 80000000 Octal = 20000000000
>> $
>
>
> I don't see any intger overflow, I see perfectly reasonable
> behaviour for a 32 bit integer.
It is very reasonable and as expected.
But it is an integer overflow.
To quote from the VAX Architecture Reference Manual:
"Integer overflow occurs if the input operands to the add have
the same sign and the results has the opposite sign."
Arne
More information about the Info-vax
mailing list