Bitwise Operator

From bibbleWiki
Revision as of 22:47, 17 April 2026 by Iwiseman (talk | contribs) (Created page with "== Bitwise Operations Overview == Bitwise operations fall into three major groups: # '''Bitwise Logic Operators''' # '''Bitwise Shift Operators''' # '''Bit Rotation Operators''' These operations work directly on the binary representation of integers. === 1. Bitwise Logic Operators === ; AND ( & ) : 0b1100 & 0b1010 = 0b1000 ; OR ( | ) : 0b1100 | 0b1010 = 0b1110 ; XOR ( ^ ) : 0b1100 ^ 0b1010 = 0b0110 ; NOT ( ~ or ! ) : ~0b00001111 = 0b11110000")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Bitwise Operations Overview

Bitwise operations fall into three major groups:

  1. Bitwise Logic Operators
  2. Bitwise Shift Operators
  3. Bit Rotation Operators

These operations work directly on the binary representation of integers.

1. Bitwise Logic Operators

AND ( & )
0b1100 & 0b1010 = 0b1000
OR ( | )
0b1100 | 0b1010 = 0b1110
XOR ( ^ )
0b1100 ^ 0b1010 = 0b0110
NOT ( ~ or ! )
~0b00001111 = 0b11110000