[Info-vax] DCL Integer Overflow
Arne Vajhøj
arne at vajhoej.dk
Sun Jul 2 16:05:46 EDT 2017
On 7/1/2017 12:46 PM, Simon Clubley wrote:
> On 2017-06-30, Arne Vajhøj <arne at vajhoej.dk> wrote:
>> On 6/30/2017 5:06 AM, GerMarsh wrote:
>>> 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
>>
>> Isn't that the expected result?
>
> It's exactly the expected result. There is an argument for whether
> DCL should either use arbitrary precision numbers instead or generate
> an exception on integer overflow, but today's DCL is behaving
> exactly as designed.
And like a lot of other languages.
Arne
More information about the Info-vax
mailing list