Documentation (c) 2006-2008 Hobby-Robotics, LLC


Mathematical operators

Mathematical operations are defined for both integral and floating point types.

Integer operators

If both values are of integral type result will be integral with the exception of the \ divide which will produce floating point value. To get integral result use Integer Divide \

Plus +

Result is sum of two expressions

Syntax:

left_expression + right_expression

Minus -

Result is subtraction of two expressions.

Syntax:

left_expression - right_expression

Multiply *

Result is multiplication of two expression.

Syntax:

left_expression * right_expression

Divide /

Result is division of two expressions.

Syntax:

left_expression / right_expression

Integer Divide \

Result is integer division of two expressions.

Integer operations are not checked for overflow.

Syntax:

left_expression \ right_expression

Floating point

Floating operation require Runtime with built-in Math support. If code is compiled with the Runtime without Math support Linker will report errors while trying to locate runtime floating point support functions.

Plus +

Result is sum of two expressions.

Syntax:

left_expression + right_expression

Minus -

Result is subtraction of two expressions.

Syntax:

left_expression - right_expression

Multiply *

Result is multiplication of two expression.

Syntax:

left_expression * right_expression

Divide /

Result is division of two expressions.

Syntax:

left_expression / right_expression

Division by 0.0 will result in runtime error &hEE2001 "Division by zero"

String operators

Concatenate & and +

Two string operators are defined, both will concatenate strings their behavior is equivalent.

Syntax:

left_expression & right_expression

left_expression + right_expression

Combined assignment operators

Combined assignment and mathematical, string or shift operators are a short form of the following general assignment expression:

symbol = symbol operator expression

which can be expressed in the short form:

symbol operator = expression

In each case the short form is equivalent to the general form of the assignment and follows the same rules.

Plus and assign +=

Syntax:

symbol += expression

Minus and assign -=

Syntax:

symbol -= expression

Multiply and assign *=

Syntax:

symbol *= expression

Divide and assign /=

Syntax:

symbol /= expression

Integer Divide and assign \=

Syntax:

symbol \= expression

Concatenate and assign &= or +=

Syntax:

symbol &= expression

symbol += expression

Shift right and assign >>=

Syntax:

symbol >>= expression

Shift left and assign <<=

Syntax:

symbol <<= expression