[Info-vax] DCL Integer Overflow

Paul Sture nospam at sture.ch
Sun Jul 2 13:02:38 EDT 2017


On 2017-07-02, Scott Dorsey <kludge at panix.com> wrote:
> <VAXman-  @SendSpamHere.ORG> wrote:
>>In article <oj8oc5$8s5$1 at panix2.panix.com>, kludge at panix.com (Scott Dorsey) writes:
>>>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
>>>
>>>This is not a bug, it's a feature.
>>>If you don't want it to roll over, what DO you want it to do?
>>>Halt with an error?
>>
>>Halt and Catch Fire!
>>
>>In need of real math?  Use Fortran!
>
> Fortran doesn't allow me to pitch an exception on integer overflow either,
> does it?  I can do it on a float, but with integers I need to check explicitly
> before every operation.

Does this help? (VAX/VMS flavour of Fortran help)

HELP FORTRAN

  /CHECK

    OVERFLOW

       Enables or disables integer overflow traps.  If /CHECK=OVERFLOW is
       specified, fixed-point calculations involving BYTE, INTEGER*2, and
       INTEGER*4 data types are checked for arithmetic overflow.  Real and
       complex calculations are always checked for overflow and are not
       affected by /NOCHECK.  Integer exponentiation is performed by a
       routine in the mathematical library.  The routine in the
       mathematical library always checks for overflow, even if
       /CHECK=NOOVERFLOW is specified.


-- 
Everybody has a testing environment. Some people are lucky enough to
have a totally separate environment to run production in.





More information about the Info-vax mailing list