function/macro | since v0.0-927 | clojure.core/bit-clear | Edit |
(bit-clear x n)
Clear bit at index n
. Same as x & ~(1 << y)
in JavaScript.
Bits can be entered using radix notation:
(bit-clear 2r1111 2)
;;=> 11
;; 11 = 2r1011
Same numbers in decimal:
(bit-clear 15 2)
;;=> 11
Clear bit at index n
(defn bit-clear
[x n]
(cljs.core/bit-clear x n))
(core/defmacro ^::ana/numeric bit-clear [x n]
(core/list 'js* "(~{} & ~(1 << ~{}))" x n))