User Guide
Chapter 348
This statement multiplies the floating-point numbers 2.0 and 3.1414 and displays the result in
the Message window:
put 2.0 * 3.1416
The result is 6.2832, which is a floating-point number.
+ (addition)
Syntax
expression1 + expression2
Description
Math operator; performs an arithmetic sum on two numerical expressions. 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.
This is an arithmetic operator with a precedence level of 4.
Examples
This statement adds the integers 2 and 3 and then displays the result, 5, an integer, in the
Message window:
put 2 + 3
This statement adds the floating-point numbers 2.5 and 3.25 and displays the result, 5.7500, a
floating-point number, in the Message window:
put 2.5 + 3.25
+ (addition) (3D)
Syntax
vector1 + vector2
vector + scalar
Description
3D vector operator; adds the components of two vectors, or adds the scalar value to each
component of the vector and returns a new vector.
vector1 + vector2 adds the components of vector1 to the corresponding to components of
vector2 and returns a new vector.
vector + scalar adds the scalar value to each of the components of the vector and returns a
new vector.
- (subtraction)
Syntax
vector1 - vector2
vector - scalar
Description
3D vector operator; subtracts the components of vector2 from the corresponding components
of
vector1, or subtracts the scalar value from each of the components and returns a new vector.