In article <8u9r96$jmb$1@wanadoo.fr>, "Jean-Pierre Rosen" wrote: > > a �crit dans le message news: 8u8j99$2rk$1@nnrp1.deja.com... > > A funny version that does not require a temp variable: > > > > procedure Swap (A, B : in out Integer) is > > begin > > if A <= B then > > A := A + B; > > B := A - B; > > A := A - B; > > end if; > > end Swap; > > > > It works better if A, B are modular (:-)) > > > But then, you have : > A:= A xor B; > B := B xor A; > A := A xor B; It will work too, but for modulus 2**n only. +/- variant should work always (:-)) -- Regards, Dmitry Kazakov Sent via Deja.com http://www.deja.com/ Before you buy.