Operators

Math, concatenation, etc.

Increment/Decrement Operators

The increment and decrement operators are just like in any other language. These operators can be in the form of a prefix or a postfix to a number variable.

Example

example_increment_decrement.cb
var i = 1;
print(i++); // Postfix, prints 2
print(++i); // Prefix, prints 2
print(--i); // Prefix, prints 3
print(i--); // Postfix, prints 2

Arithmetic Operators

Arithmetic operators are pretty straightforward. Just use them as if you were writing a math equation.

Example

example_arithmetic.cb
var a = 1;
var b = 2;
println(a + b); // Addition, prints 3
println(a - b); // Subtraction, prints -1
println(a / b); // Division, prints 0.5
println(a * b); // Multiplication, prints 2