4

SQRT (INT, DINT, REAL)

The Square Root (SQRT) function is used to find the square root of a value. When the function receives power flow, the value of output Q is set to the integer portion of the square root of the input IN. The output Q must be the same data type as IN.

The SQRT function operates on these types of data:

Data Type

Description

INT

Signed integer.

 

 

DINT

Double precision signed integer.

 

 

REAL

Floating Point.

 

 

Note

The REAL data type is only available on 350 and 360 series CPUs, Release 9 or later, or on all releases of CPU352.

The default data type is signed integer; however, it can be changed after selecting the function. For more information on data types, please refer to chapter 2, section 2, “Program Organization and User References/Data.”

OK is set ON if the function is performed without overflow, unless one of these invalid REAL operations occurs:

IN < 0.

IN is NaN (Not a Number). Otherwise, ok is set OFF.

_____

(enable)

(ok)

INT

(input parameter IN) —IN

Q— (output parameter Q)

_____

Parameters:

Parameter

Description

enable

When the function is enabled, the operation is performed.

 

 

IN

IN contains a constant or reference for the value whose square root is to be

 

calculated. If IN is less than zero, the function will not pass power flow.

 

 

ok

The ok output is energized when the function is performed without overflow, unless an

 

invalid operation occurs.

 

 

Q

Output Q contains the square root of IN.

 

 

GFK-0467K

Chapter 4 Series 90-30/20/Micro Instructions Set

4-33

Page 114
Image 114
GE 90-30/20/Micro manual Sqrt INT, DINT, Real