Github
Introductio

1. Arithmetic Operators in Wave

Arithmetic operators in Wave include standard mathematical operations like addition, subtraction, multiplication, and division.

Example:

var result: i32 = 10 + 5;  // Addition
result = result - 3;      // Subtraction
result = result * 2;      // Multiplication
result = result / 2;      // Division

2. Comparison Operators in Wave

Comparison operators are used to compare values and include operators such as ==, !=, >, <, etc.

Example:

if (a == b) {
    println("Equal");
}
if (c != d) {
    println("Not Equal");
}

3. Logical Operators in Wave

Logical operators in Wave include && (AND), || (OR), and ! (NOT) for boolean logic.

Example:

if (x > 10 && y < 20) {
    println("Condition met");
}
if (!isReady) {
    println("Not ready");
}

4. Bitwise Operators in Wave

Wave supports bitwise operators such as & (AND), | (OR), ^ (XOR), and ~ (NOT) for low-level bit manipulation.

Example:

var bitResult: i32 = a & b;  // Bitwise AND
bitResult = a | b;        // Bitwise OR
bitResult = a ^ b;        // Bitwise XOR
bitResult = ~a;           // Bitwise NOT

5. Special Operators in Wave

Wave includes special operators like the null-coalescing operator ?? and the conditional (ternary) operator ?: for additional flexibility in expressions.

Example:

var value = optionalValue ?? defaultValue;  // Null-coalescing
var result = (a > b) ? "A is greater" : "B is greater";  // Conditional operator

Language

features
Wave

Sponsors ❤

Tools

Modes

light

light

dark

dark

Sidebar

Backgrounds

default

Default

bg-1

Bg-1

bg-2

Bg-2

bg-3

Bg-3

bg-4

Bg-4

bg-5

Bg-5

Box Design

default

Default

box-1

Box-1

box-2

Box-2

box-3

Box-3