Chapter 8. Structured Text (ST) Programming366 PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual GFK-2950C8.1.3 OperatorsThe table below lists the operators that you can use within an expression. They are listed accordingto their evaluation precedence, which determines the sequence in which they are executed withinthe expression. The operator with the highest precedence is applied first, followed by the operatorwith the next highest precedence. Operators of equal precedence are evaluated left to right.Operators in the same group, for example + and -, have the same precedence.Any address operators used in LD can be used on ST operands. Address operators have precedenceover the ST language operators. Address operators include indirect addressing (for example, @Var1),array indexing (for example, Var1[3]), bit within word addressing (for example, Var1.X[3]), andstructure fields (for example, Var1.field1).Precedence Operator Operand Types DescriptionGroup 1 (Highest) (…) ParenthesizedexpressionGroup 2 - INT, DINT, REAL, LREAL NegationNOT BOOL, BYTE, WORD, DWORD Boolean complementGroup 3 **,^ INT, DINT, UINT, REAL, LREAL8 Exponentiation9, 10Group 4 * INT, DINT, UINT, REAL, LREAL Multiplication9/ INT, DINT, UINT, REAL, LREAL Division9, 11MOD INT, DINT, UINT Modulus operation11Group 5 + INT, DINT, UINT, REAL, LREAL Addition9- INT, UINT, DINT, REAL, LREAL Subtraction9Group 6 <, >, <=,>=INT, DINT, UINT, REAL, LREAL, BYTE, WORD,DWORDComparisonGroup 7 = ANY12 Equality<>, != ANY12 InequalityGroup 8 AND, & BOOL, BYTE, WORD, DWORD Boolean ANDGroup 9 XOR BOOL, BYTE, WORD, DWORD Boolean exclusive ORGroup 10 (Lowest) OR BOOL, BYTE, WORD, DWORD Boolean ORSome comparison and math operators have corresponding built-in functions. For instance, the ‘+’operator is similar to the ADD_INT function. You can use either the language operator or the built-infunction. The built-in function has the advantage of returning an ENO status. For additionalinformation refer to Built-in Functions Supported for ST Calls.Operand TypesType casting is not supported. To convert a type, use one of the built-in conversion functions. Use ofbuilt-in functions is described in Function Call.For untyped operators (+, *, …), the types of the operands must match.8 The base must be type REAL or LREAL. If the base is REAL, the power can be type INT, DINT, UINT, or REAL and the result istype REAL. If the base is type LREAL, the power must be LREAL and the result will be LREAL9 Use of math operators can cause Overflow or underflow. Overflow results are truncated.10 If either operand is positive or negative infinity, the result is undefined.11 The CPU flags a “divide-by-0” error as an application fault.12 Operators that can take operands of type ANY can be used with any of the supported elementary data types. Thesupported data types are: BOOL, INT, DINT, UINT, BYTE, WORD, DWORD, LREAL and REAL. STRING and TIME data typesare not supported