bit-xor

function/macrosince v0.0-927 clojure.core/bit-xorEdit
(bit-xor x y)
(bit-xor x y & more)

Details:

Bitwise "exclusive or". Same as x ^ y in JavaScript.


Examples:

Bits can be entered using radix notation:

(bit-xor 2r1100 2r1010)
;;=> 6
;; 6 = 2r0110

Same numbers in decimal:

(bit-xor 12 10)
;;=> 6

See Also:


Source docstring:
Bitwise exclusive or
Function code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn bit-xor
  ([x y] (cljs.core/bit-xor x y))
  ([x y & more]
     (reduce bit-xor (cljs.core/bit-xor x y) more)))

Macro code @ clojurescript:src/main/clojure/cljs/core.cljc
(core/defmacro ^::ana/numeric bit-xor
  ([x y] (core/list 'js* "(~{} ^ ~{})" x y))
  ([x y & more] `(bit-xor (bit-xor ~x ~y) ~@more)))