DEV Community

Discussion on: Write a function that shows off something unique or interesting about the language you're using

Collapse
 
dwd profile image
Dave Cridland

So does C:

int a = 1, b = 999;
a ^= b;
b ^= a;
a ^= b;

OK, so this is specific to numeric values, actually, but it comes in handy in cryptographic code for constant time conditional swaps and things.

Collapse
 
dance2die profile image
Sung M. Kim

Thanks Dave.
There is no end to learning.
I feel humbled :)