you could also switch on overflow  checks and get a trap ...

(see enclosed docu by Gérard)
--
  Bernhard Treutwein

> -----Original Message-----
> From: BlackBox [mailto:BLACKBOX@LISTS.OBERON.CH] On Behalf Of 
> luowy@SOHU.COM
> Sent: Thursday, April 07, 2011 12:25 AM
> To: BLACKBOX@LISTS.OBERON.CH
> Subject: [BLACKBOX] INTEGER Add Has Wrong result
> 
> 
> look it:
> 
> MODULE Test;
>     IMPORT StdLog;
> 
>     PROCEDURE Do*();
>       VAR i,j:INTEGER;l:LONGINT;
>     BEGIN
>       i:=MAX(INTEGER);(* 07FFFFFFH *)
>       j:=1;
>       l:=i+j;(* l should be 080000000L *)
>       StdLog.Int(l);Log.Ln; (* ????  l:= -2147483648;  
> 0FFFFFFFF80000000L   *)
>     END Do;
> 
> END Test.
> 
> 
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" 
> to LISTSERV@LISTS.OBERON.CH
> 

----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV@LISTS.OBERON.CH