function/macro | since v0.0-927 | clojure.core/bit-shift-left | Edit |
(bit-shift-left x n)
Bitwise shift left n
bits. Same as x << n
in JavaScript.
Bits can be entered using radix notation:
(bit-shift-left 2r0101 1)
;;=> 10
;; 10 = 2r1010
Same numbers in decimal:
(bit-shift-left 5 1)
;;=> 10
Bitwise shift left
(defn bit-shift-left
[x n] (cljs.core/bit-shift-left x n))
(core/defmacro ^::ana/numeric bit-shift-left [x n]
(core/list 'js* "(~{} << ~{})" x n))