EasyManua.ls Logo

Mitsubishi QD51 - Page 36

Mitsubishi QD51
688 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
2 - 19 2 - 19
MELSEC-Q
2 THE BASICS OF AD51H-BASIC
In order to change the order of operations, parentheses are used. When a portion of
an expression is surrounded by parentheses, the operation within the parentheses are
performed first. When an operator is followed by another operator, parentheses must
be used.
Operations on double-precision real numbers may be performed in arithmetic
operations, but numbers lifted to higher powers are all converted to single-precision.
Some algebraic numeric expressions and their corresponding BASIC expressions are
shown below.
Algebraic expression BASIC expression
X+2Y • • • • • • • X+Y 2
X-
Y
Z
• • • • • • • X-Y/Z
XY
Z
• • • • • • • X Y/Z
X+Y
Z
• • • • • • • (X+Y)/Z
(X
2
)
y
• • • • • • • (X^2)^Y/
X
Y
Z
• • • • • • • X^(Y^Z)
X(-Y) • • • • • • • X (-Y)
Note that the multiplication,
division, and power symbols
are different from their
mathematical symbols.
n
^
n
/
• Integer division and remainder operations
Integer division operations are expressed using ¥. Fractional portion of divisor,
dividend, and the quotient are dropped before the operation and rounded to integers.
Example
PRINT 10@ 4
2
OK
PRINT 25.6@ 6.99 The dividend is rounded down to 25,
the divisor to 6, and the quotient to 4.
4
OK
…………
Remainder operations are expressed using the operator MOD and gives the
remainder in integer division integer format.
Example
PRINT 15.4 MOD 4 The remainder left after
3
OK
PRINT 25.68 MOD 6.9 The remainder left after
1
OK
dividing 15 by 4 is 3.
dividing 25 by 6 is 1.

Other manuals for Mitsubishi QD51

Related product manuals