2 - 18 2 - 18
MELSEC-Q
2 THE BASICS OF AD51H-BASIC
(4) When a numeric value of fixed decimal point format is converted to an integer, the
decimal fraction is disregarded.
Example
10 C%=55.88
20 PRINT C%
RUN
55
OK
(5) If a single-precision value is assigned to a double-precision variable, only the
rounded first seven digits of the converted numeric value will be valid. This is
because single-precision numeric values can hold an accuracy of up to seven
digits.
Example
10 A=2.04
20 B#=A
30 PRINT A;B#
RUN
2.04 2.039999961853027
OK
2.10 Expressions and Operators
Expressions are simply constants or variables combined in order to obtain a character
string constant, numeric constant, variable, function, or a certain value. Numeric
expressions deal with numeric values and character string expressions deal with
character strings.
Operators perform arithmetic or logical operations on each value.
Operators can be classified into the following three types.
(1) Arithmetic operator
(2) Relational operator
(3) Logical operator
2.10.1 Arithmetic operators
When one expression contains multiple arithmetic operators, the operation will be
performed in the following priority order.
Operator
Meaning
Example
^
Power
• • • • •
X^Y
–
Change sign
• • • • •
–Y
*, /
Multiplication, floating point division
• • • • •
X*Y, X/Y
+, -
Addition, subtraction
• • • • •
X+Y
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...