bit-shift-left

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

Details:

Bitwise shift left n bits. Same as x << n in JavaScript.


Examples:

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

See Also:


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

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