![background image](http://html1.mh-extra.com/html/omron/c500-asc04/c500-asc04_operation-manual_743033036.webp)
25
•
Relational
•
Logical
•
Character
Of these, the first three produce numeric values as a result, and are thus called,
“numeric expressions.” The last type is called a “character expression.”
An arithmetic expression is made up of constants, variables, and functions com-
bined using arithmetic operators. A list of valid arithmetic operators is shown in
the following table.
Arithmetic Operator
Example
Operation
+
–
*
/
MOD
^
A + B
A – B, –A
A * B
A / B
A \ B
A MOD B
A ^ B
Addition
Subtraction or negation
Multiplication
Real number division
Integer division
Remainder after integer division
Exponentiation
\
Note If A or B is a real number in an expression using the \ or MOD operator, the deci-
mal part is first rounded up to convert the real number into an integer, and then
the operation is performed.
Relational operators compare two values. The output is “–1” (&HFFFF) if the two
values are equal and “0” if they are not.
Relational Operator
Example
Operation
=
<>,><
<
>
A = B
A <> B
A < B
A > B
A
≤
B
A
≥
B
Equal
Not equal
Less than
Greater than
Less than or equal to
Greater than or equal to
≤
≥
Character Operator
A character expression is made up of character constants and variables that are
linked with the character operator “+”. Instead of adding characters together, the
“+” operator links the characters together to form one character value.
Input:
A$=“CF” B$=“BASIC” PRINT A$+“–”+B$
Output: “CF–BASIC” is displayed.
Logical Operators
Logical Operators perform tests on multiple relations, bit manipulation, or bool-
ean operations. The logical operator returns a bit result which is either “true” (not
0) or “false” (0). In an expression, logical operations are performed after arithme-
tic and relational operations. The outcome of a logical operation is determined
Arithmetic Operators
Relational Operators
Program Configuration
Summary of Contents for C500-ASC04
Page 1: ...C500 ASC04 ASCII Unit Operation Manual Revised February 2001 ...
Page 5: ...iv ...
Page 7: ...vi ...