4 OPERATION CONTROL PROGRAMS
4.7 Standard Functions
155
4
Round-off: RND
■Usable data
: Usable
■Description, data type of result
• The rounded-off fractional portion value of the data specified with (S) is found.
• If (S) is a negative number, the absolute value of (S) is found and its fractional portion is rounded off and signed.
• If (S) is an integer type, its value is returned unchanged, with no conversion processing performed.
An operation error will occur if:
• (S) is an indirectly specified device and its device No. is outside the range.
■Program which finds the rounded-off fractional portion value of D0F and substitutes the result
to #0F
■Program which finds the rounded-off fractional portion value of D4F and substitutes the result
to #0F (when D4F is a negative number)
Format Number of basic steps Usable steps
F/FS G
RND(S) 4
Setting
data
Usable Data
Bit
device
Word device Constant Calculation
expression
Bit
conditional
expression
Comparison
conditional
expression
16-bit
integer
type
32-bit
integer
type (L)
64-bit
floating
point
type (F)
16-bit
integer
type
(K/H)
32-bit
integer
type
(K/H, L)
64-bit
floating
point
type (K)
(S)
Setting data Description Data type of result
(S) Data whose fractional portion will be rounded off Data type of (S)
#0F = RND(D0F)
34.0
#2 #1#3 #0
#0F 33.54
D2 D1D3 D0
D0F
#0F = RND(D4F)
-33.0
#2 #1#3 #0
#0F -33.44
D6 D5D7 D4
D4F