Operators

Last updated: Mar 4th, 2018

Operators and Operands

The numbers in an arithmetic operation are called operands.
The operation to be performed between the two operands is defined by an operator.

Operand Operator Operand
50 + 60

Assignment

The assignment operator (=) assigns a value to a variable.

var x = 10;

Addition

The addition operator (+) adds numbers:


var x = 5;
var y = 6;
var z = x + y;
                                    

Multiplication

The addition operator (*) multiplies numbers:


var x = 5;
var y = 6;
var z = x * y;
                                    

Cuneiform Arithmetic Operators

Arithmetic operators are used to perform arithmetic operations on numbers.

Operator Description
+ Addition
- Subtraction
* Multiplication
/ Float division
div Integer division

Cuneiform Comparison Operators

Operator Description
== Equal to
!= Not equal
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to

Cuneiform Logical Operators

Operator Description
&& Logical and
|| Logical or
! Logical not

What's next?

Next, we will explore conditionals, which make use of comparison operators.