bit-flip

clojure.core

  • (bit-flip x n)
Flip bit at index n

1 Example top

  • user=> (bit-flip 2r1011 2)
    15 
    ;; 15 = 2r1111
    
    (bit-flip 2r1111 2)
    11 
    ;; 11 = 2r1011
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:1278 top

(defn bit-flip
  "Flip bit at index n"
  {:added "1.0"
   :static true}
  [x n] (. clojure.lang.Numbers flipBit x n))
Vars in clojure.core/bit-flip:
Used in 0 other vars

Comments top

No comments for bit-flip. Log in to add a comment.