plus (addition)
Top  Previous  Next


Syntax
expression1 + expression2

Arguments
expression: A number or a variable that evaluates to a number.

Returns
Floating-point result of expression1 + expression2.

Description
If both expressions are integers, the sum is an integer. If either or both expressions are floating-point numbers, the sum is a floating-point number

Sample
This statement below adds the integers 2 and 3 and displays the resulting integer, 5, in the 'Debug' window:
trace (2
 + 3);

This statement below adds the floating-point numbers 2.5 and 3.25 and displays the result, 5.75, a floating-point number, in the 'Debug' window:
trace (2.5 + 3.25);

This statement will add the sum of both variables as numbers:
onLoad() {
   num1 = "10";
   num2 = "9.55";
   trace(num1 plus num2);
}

// The output in the 'Debug' window will be 19.55


See Also
+ (addition), add (concat strings)