Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Operations & Expressions

AzLang supports standard binary and unary operations with strict type checks enforced during compiler validation.


1. Arithmetic Operators

AzLang supports the standard arithmetic operations:

OperatorMeaningExample
+Additiona + b
-Subtractiona - b
*Multiplicationa * b
/Divisiona / b
%Moduloa % b

Example:

const int a = 10
const int b = 3
const int sum = a + b
const int rem = a % b

2. Comparison Operators

Comparisons evaluate to a bool (true or false):

OperatorDescription
==Equal
!=Not equal
>Greater than
>=Greater than or equal
<Less than
<=Less than or equal

Example:

const bool is_equal = (a == b)
const bool is_positive = (a > 0)

3. Logical Operators

AzLang provides natural keywords as well as standard symbol alternatives:

  • and / && : Logical AND
  • or / \|\| : Logical OR
  • ! : Logical NOT
if a > 0 and b > 0
    // block