PDA

View Full Version : Re: [LF] swaping


Lahey Support
08-15-2003, 01:19 AM
At 10:53 AM 2/1/1999 +0100, Jacek Magiera wrote:
>Hi, what about a sequence like this:
>
>A = A - B
>B = B + A
>A = B - A ?
>
>It's variable type independent.
>
>Jacek Magiera,


It works out algebraically, but beware of overflows. It may also result in
inexact floating point swaps using due to roundoff.


David Bubenik