Re: [BLACKBOX] INTEGER Add Has Wrong result

From: [at]} <Treutwein>
Date: Thu, 7 Apr 2011 08:50:51 +0200

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{([at]})nowhere.xy> luowy{([at]})nowhere.xy> Sent: Thursday, April 07, 2011 12:25 AM
> To: BLACKBOX{([at]})nowhere.xy> 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{([at]})nowhere.xy> 
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy

attached mail follows:





Received on Thu Apr 07 2011 - 08:50:51 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:15 UTC