Ok, this is pretty simple
to do, but I've found that many people think it can't be done...so here it is, in all of it's perl
ified glory. This takes two arguments on the command line
, stores them in 2 seperate variables, then swaps them, without using a third. The print statements are not neccessary, they are only there to prove
that this does indeed work.
This is applicable to most any programming language
you can think of.
No preformatting tool was used on the above text - all mistakes, syntactical, logical, or otherwise, are mine
. I also haven't tested this for x as x->+/- infinity yet, so if it doesn't work for some obscure value, tough beans. I thought it was nifty