Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

bit mask

A number whose 1 bits pick out the bits you care about, used with AND, OR or XOR to test, set, clear or flip them.

A mask m selects bit positions; x | m sets them, x & ~m clears them, x ^ m toggles them, and x & m tests them.

Examples

  • x & 0xFF keeps the low byte of x; x | (1 << 3) sets bit 3.

Read the full section →