2-181
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Math Instructions
2
SQRT
The following example is for when In is REAL#16.0. The value of variable abc will be REAL#4.0.
Use the CheckReal instruction (page 2-209) to see if the value of Out is positive infinity.
• If the value of In is not a positive number, the value of Out is as shown below.
• If you pass an integer parameter to In, the data type is converted as follows:
Additional Information
Precautions for Correct Use
Value of In Value of Out
Negative number Nonnumeric data
00
+∞ +∞
−∞
Nonnumeric data
Nonnumeric data Nonnumeric data
Data type of parameter that is
passed to In
Data type of In
USINT, UINT, SINT, or INT REAL
UDINT or DINT LREAL
ULINT or LINT A building error will occur.
abc:=SQRT(REAL#16.0);
LD ST
abc
REAL#16.0
SQRT
EN ENO
In