function/macro | since v0.0-927 | clojure.core/bit-and | Edit |
(bit-and x y)
(bit-and x y & more)
Bitwise "and". Same as x & y
in JavaScript.
Bits can be entered using radix notation:
(bit-and 2r1100 2r1010)
;;=> 8
;; 8 = 2r1000
Same numbers in decimal:
(bit-and 12 10)
;;=> 8
Bitwise and
(defn bit-and
([x y] (cljs.core/bit-and x y))
([x y & more]
(reduce bit-and (cljs.core/bit-and x y) more)))
(core/defmacro ^::ana/numeric bit-and
([x y] (core/list 'js* "(~{} & ~{})" x y))
([x y & more] `(bit-and (bit-and ~x ~y) ~@more)))