Expressions - Omron C200H-ASC11 Manual

Ascii units
Hide thumbs Also See for C200H-ASC11:
Table of Contents

Advertisement

Program Configuration
7-4-8

Expressions

Character Operators
Arithmetic Operators
a long integer within the range of –2147483648 to 2147483647, an over-
flow error will occur.
Example:
LET A = NOT 12.34, –13 is assigned as A.
5. When a real number is converted into an integer, the value is rounded.
Example:
A = 12.3: "12" is assigned to A.
B = 12.6: "13" is assigned to B.
Expressions refer to constants, variables, and functions that have been com-
bined by operators. Numeric values, variables, or characters alone can also
form expressions. There are four types of expressions.
• Arithmetic
• 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."
Expression
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
string.
Input:
A$ = "CF"
B$ = "BASIC"
PRINT A$ + "–" + B$
Output: CF–BASIC" is displayed.
An arithmetic expression is made up of constants, variables, and functions
combined using arithmetic operators. A list of valid arithmetic operators is
shown in the following table.
Arithmetic operator
+
*
/
\
MOD
^
If A or B is a real number in an expression using the \ or MOD operator, the
decimal part is first rounded up to convert the real number into an integer, and
then the operation is performed.
Character operator
Numeric expression
Example
A + B
Addition
A – B, –A
Subtraction or negation
A * B
Multiplication
A / B
Real number division
A \ B
Integer division
A MOD B
Remainder after integer division
A ^ B
Exponentiation
Section 7-4
Arithmetic operator
Relational operator
Logical operator
Operation
127

Advertisement

Table of Contents
loading

This manual is also suitable for:

C200h-asc21C200h-asc31

Table of Contents