Arithmetic and Comparison Operators
The core math and relational operators.
Math, the Zig Way
Zig gives you the everyday math operators you expect, but with one promise: nothing happens behind your back. Every operation is explicit and predictable.
The Four Basics
You add, subtract, multiply, and divide with +, -, *, and /. They read exactly like ordinary arithmetic, so simple math feels natural. 🙂
const sum = 2 + 3;
const product = 4 * 5;All lessons in this course
- Arithmetic and Comparison Operators
- Overflow: + vs +% vs +|
- Bitwise Operators
- Boolean Logic and Short-Circuiting