function/macro | since v0.0-927 | clojure.core/bit-shift-right | Edit |
(bit-shift-right x n)
Bitwise shift right n
bits. Same as x >> n
in JavaScript.
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
Bitwise shift right
(defn bit-shift-right
[x n] (cljs.core/bit-shift-right x n))
(core/defmacro ^::ana/numeric bit-shift-right [x n]
(core/list 'js* "(~{} >> ~{})" x n))