[Info-vax] DCL Integer Overflow
Simon Clubley
clubley at remove_me.eisner.decus.org-Earth.UFP
Sat Jul 1 12:46:50 EDT 2017
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.
Simon.
--
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
More information about the Info-vax
mailing list