## Other Operators

Operator
Description
Examples
[ ]
Array concatenation.
The expression `[A,B]` is an array formed by concatenating A and B.

;Define C as three-point vector:

C = [0, 1, 3]

;Add 5 to the end of C:

PRINT, [C, 5]

IDL Prints: `0 1 3 5`
```
```

;Insert -1 at the beginning of C:

PRINT, [-1, C]

IDL Prints: `-1 0 1 3`
Enclose array subscripts

A = [2, 1, 5]

;Print the 3rd element in A:

PRINT, A[2]

IDL Prints: `5`
( )
Group expressions to control order of evaluation

PRINT, 3 + 4 * 2 ^ 2 /2

IDL Prints: `11`
```
```

PRINT, (3 + (4 * 2) ^ 2 / 2)

IDL Prints: `35`
=
Assignment
```;Assign 5 to variable A:
```

A = 5

;Assign "Hello World" to variable B:

B='Hello World'

op=
Compound Assignment
where op is one of the following operators: ##, #, *, +, -, /, <, >, ^, AND, EQ, GE, GT, LE, LT, MOD, NE, OR, XOR
Applies the specified operation to the target variable "in place," without making a copy of the variable. For example,

A += 5

adds 5 to the value of the variable A.
Note -

A op= expression

is equivalent to:

A = TEMPORARY(A) op (expression)

?:
Conditional expression.
For
value=expr1 ? expr2 : expr3
expr1 is evaluated first. If expr1 is true, then value=expr2. If expr1 is false, value=expr3.
```A=6 & B=4
;Set Z to the greater of A and B:
Z = (A GT B) ? A : B
PRINT, Z

```
IDL Prints: `6`