Logo

Programming-Idioms

# 237 Xor integers
Assign to c the result of (a xor b)
New implementation

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating material.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
(def c (bit-xor a b))
int c = a ^ b;
int c = a ^ b;
var c = a ^ b;
use Bitwise
c = a ^^^ b
C = A bxor B
c = ieor(a,b)
c := a ^ b
import "math/big"
c := new(big.Int)
c.Xor(a, b)
import Data.Bits (xor)
c = xor a b
const c = a ^ b;
int c = a ^ b;
c := a xor b;
my $c = $a ^ $b;
c = a ^ b
c = a ^ b
let c = a ^ b;
Dim c As Integer = a Xor b