SQRT¶
Returns the square root of a numeric input.
Signature¶
┌─────────┐
IN ─┤ SQRT ├─ OUT
└─────────┘
FUNCTION SQRT : ANY_REAL
VAR_INPUT
IN : ANY_REAL;
END_VAR
END_FUNCTION
The return type matches the input type. SQRT accepts REAL,
LREAL.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
The non-negative value to compute the square root of. |
Outputs
Name |
Type |
Description |
|---|---|---|
Return value |
|
The square root of IN. Same type as IN. |
Description¶
Returns the square root of IN. The input must be non-negative;
the result of SQRT applied to a negative value is undefined.
Example¶
result := SQRT(REAL#9.0); (* result = 3.0 *)
value := SQRT(LREAL#2.0); (* value = 1.41421356... *)
See Also¶
References¶
IEC 61131-3 §2.5.1.5.2