Round-Off: Rnd - Mitsubishi Electric R16MTCPU Programming Manual

Hide thumbs Also See for R16MTCPU:
Table of Contents

Advertisement

Round-off: RND

Format
RND(S)
Setting data
■Usable data
: Usable
Setting
Usable Data
data
Bit
Word device
device
16-bit
integer
type
(S)
■Description, data type of result
Setting data
Description
(S)
Data whose fractional portion will be rounded off
Processing details
• 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.
Operation error
An operation error will occur if:
• (S) is an indirectly specified device and its device No. is outside the range.
Program example
■Program which finds the rounded-off fractional portion value of D0F and substitutes the result
to #0F
#0F = RND(D0F)
#3
#2
#0F
34.0
■Program which finds the rounded-off fractional portion value of D4F and substitutes the result
to #0F (when D4F is a negative number)
#0F = RND(D4F)
#3
#2
#0F
-33.0
Number of basic steps
4
Constant
32-bit
64-bit
16-bit
integer
floating
integer
type (L)
point
type
type (F)
(K/H)
#1
#0
D0F
#1
#0
D4F
Usable steps
F/FS
Calculation
expression
32-bit
64-bit
integer
floating
type
point
(K/H, L)
type (K)
Data type of result
Data type of (S)
D3
D2
D1
33.54
D7
D6
D5
-33.44
4 OPERATION CONTROL PROGRAMS
G
Bit
Comparison
conditional
conditional
expression
expression
D0
D4
4.7 Standard Functions
4
155

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

R64mtcpuMelsec iq-r seriesR32mtcpu

Table of Contents