+ Operator

Computes the sum of two numbers or permits expression of a positive number.

Syntax

Binary form

expression_1 + expression_2

Unary form

+ expression_1

Parts

expression_1
Necessary in the binary form; a numeric or string expression
Necessary in the unary form; a numeric expression
expression_2
Necessary in the binary form; an expression of a type compatible with expression_1

Instructions

The binary + operator adds the values of two numeric expressions and returns their numeric sum.

If both expressions are of type string, the result is a new string formed by the concatenation of expression_1 and expression_2, in that order. It is functionally equivalent to the & operator, but has slightly higher precedence.

The unary + operator passes the numeric value of expression_1 unchanged. Thus, it is often referred to as the identity function in mathematics.

Examples

See also