Jason Novinger ( jnovinger@programming.dev ) M to Python@programming.dev · 3 years ago[Meme] Swapping integers in Pythonlemmy.worldimagemessage-square17linkfedilinkarrow-up137file-textcross-posted to: bumba@boomer.casinoprogrammerhumor@lemmy.ml
arrow-up137image[Meme] Swapping integers in Pythonlemmy.worldJason Novinger ( jnovinger@programming.dev ) M to Python@programming.dev · 3 years agomessage-square17linkfedilinkfile-textcross-posted to: bumba@boomer.casinoprogrammerhumor@lemmy.ml
minus-squareActuallyRuben ( ActuallyRuben@actuallyruben.nl ) linkfedilinkarrow-up2·3 years agoCouldn’t have explained it better myself. I don’t remember where exactly I first read about this trick, but it’s mainly useful in C or Assembly, as you don’t have to resort to using a third variable/register.
Couldn’t have explained it better myself. I don’t remember where exactly I first read about this trick, but it’s mainly useful in C or Assembly, as you don’t have to resort to using a third variable/register.