0Pricing
Zig Academy · Lesson

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

  1. Arithmetic and Comparison Operators
  2. Overflow: + vs +% vs +|
  3. Bitwise Operators
  4. Boolean Logic and Short-Circuiting
← Back to Zig Academy