# Operators

## Operators

An operator, in a programming language, is a symbol that represents an action. It tells the program to perform specific mathematical, relational, logical or assignment actions on given values to produce a final result. The values on which the action is performed are known as the operands. The operands can be Zoho Creator fields, variables declared in Deluge or expressions.

Example:

(7 * 7) + 4 = 53
"Hello" + "world" = "Hello world" // concatenates string values

The different types of operators are:

## Arithmetic Operators

An arithmetic operator, operates on one or two numeric value and returns a numeric value.

Syntax

<op1> <Operator> <op2>

where, <op1> and <op2> are both numeric expressions. The table below lists the binary arithmetic operators and their functionality:

 Operator Syntax Description + x + y Addition operator: Adds the value of x to the value of y. If x and y are Integers or Doubles, adds the value of x to the value of y. If a Double is used, the result is a Double.If x is a Date or Date-Time and y is an Integer, returns error "Left expression is of type TIMESTAMP and right expression is of type BIGINT and operator + is not valid"If x and y is a string, concatenates y to the end of x. - x - y Subtraction operator: Subtracts the value of y from the value of x.If x and y are Integers or Doubles, subtracts the value of y from the value of x. If a Double is used, the result is a Double.If x is a Date or Date-Time and y is an Integer, returns error "Left expression is of type TIMESTAMP and right expression is of type BIGINT and operator + is not valid" * x * y multiplies and / x / y divides by % x % y remainder when dividing by

## Relational Operators

A relational operator compares two values and returns a boolean expression (true or false) depending on the relation between the two values.

Example

5 > 4 -> true
233.6 < 94.22 -> false

Syntax

<op1> <Operator> <op2>

The table below lists the binary arithmetic operators and their functionality:

 Operator Functionality > is greater than >= is greater than or equal to < is less than <= is less than or equal to == is equal to != is not equal to

## Conditional Operators

Relational operator combined with conditional operators, make your decision making more powerful. A conditional operator operates on boolean expression and each boolean expression may contain relational operator or conditional operator, thus enabling us to write complex decision logics. Deluge supports the conditional operators '&&' , '||' and '!'.

Syntax

<boolean expression> && <boolean expression>
<boolean expression> || <boolean expression>
! <boolean expression>

where,

'&&' - returns true only if both the left and right boolean expressions are true.
'||' - returns true if atleast one of the boolean expression evaluates to true.
'!' - returns true if the boolean expression is false and vice-versa.

 Operator Functionality && Both the left and right boolean expressions are true ll Atleast one of the boolean expression is true ! boolean expression is false

## Assignment Operators

To assign values to the left operand, with or without performing arithmetic operations, based on the value of the right operand

Example

x += 1
// x = x + 1 = 3

The table below lists the binary assignment operators and their functionality:

 Operator Example = x = 2   // assigns the value 2 to x. += x += 1     // x = x + 1 = 3 -= x -= 1      // x = x - 1 = 2 *= x *= 1      // x = x * 1 = 2 /= x /= 1      // x = x / 1 = 2 %= x %= 1    // x = x % 1 = 0