Attention

IronPLC can only run very simple programs. The steps described are accurate but many language features are not yet supported.

SQRT

Returns the square root of a numeric input.

IEC 61131-3

Section 2.5.1.5.2

Support

Supported

Signatures

#

Input (IN)

Return Type

Support

1

REAL

REAL

Supported

2

LREAL

LREAL

Supported

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

  • ABS — absolute value

  • EXPT — exponentiation

  • EXP — natural exponential