1.2.0 permalink Arrow_down_16x16
  • (powers-of-2)
Returns a lazy sequence of all the powers of 2

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/lazy_seqs.clj:87 top

(defn powers-of-2
  "Returns a lazy sequence of all the powers of 2"
  []
  (iterate #(bit-shift-left % 1) 1))
Vars in clojure.contrib.lazy-seqs/powers-of-2: bit-shift-left defn iterate
Used in 0 other vars

Comments top

No comments for powers-of-2. Log in to add a comment.