bit-clear

function/macrosince v0.0-927 clojure.core/bit-clearEdit
(bit-clear x n)

Details:

Clear bit at index n. Same as x & ~(1 << y) in JavaScript.


Examples:

Bits can be entered using radix notation:

(bit-clear 2r1111 2)
;;=> 11
;; 11 = 2r1011

Same numbers in decimal:

(bit-clear 15 2)
;;=> 11

See Also:


Source docstring:
Clear bit at index n
Function code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn bit-clear
  [x n]
  (cljs.core/bit-clear x n))

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