On Tue, 5 Jul 2005 09:19:42 +0200 (CEST)
"Peter Vreman" <[EMAIL PROTECTED]> wrote:

> The following code also fails with an overflow
> 
> {$Q+}
> var
>   v : cardinal;
> begin
>   v:=100;
>   inc(v,-1);
> end.
> 
> The reason is that -1 is in fact an addition of $ffffffff resulting in the
> carry flag being set and therefor an overflow.

If adding a negative number to an unsigned one, the overflow flag needs to be 
inverted ?

Micha

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to