|
|
|
|
|
by scj
2825 days ago
|
|
Why would a==b be a problem with the XOR swap trick? function xorSwapTest(min, max) {
for (var i = min; i < max; i++) {
var a = i, b = i;
b ^= a;
a ^= b;
b ^= a;
if (a != i || b != i)
throw Error("Problem with " + i);
}
return true;
}
|
|