bit-shift-right

function/macrosince v0.0-927 clojure.core/bit-shift-rightEdit
(bit-shift-right x n)

Details:

Bitwise shift right n bits. Same as x >> n in JavaScript.


Examples:

Bits can be entered using radix notation:

(bit-shift-right 2r1010 1)
;;=> 5
;; 5 = 2r0101

Same numbers in decimal:

(bit-shift-right 10 1)
;;=> 5

See Also:


Source docstring:
Bitwise shift right
Function code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn bit-shift-right
  [x n] (cljs.core/bit-shift-right x n))

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