9.255. SQRT

9.255 SQRT — Square-root function

Description:

SQRT(X) computes the square root of X.

Standard:

Fortran 77 and later

Class:

Elemental function

Syntax:

RESULT = SQRT(X)

Arguments:
X The type shall be REAL or COMPLEX.
Return value:

The return value is of type REAL or COMPLEX. The kind type parameter is the same as X.

Example:
program test_sqrt
  real(8) :: x = 2.0_8
  complex :: z = (1.0, 2.0)
  x = sqrt(x)
  z = sqrt(z)
end program test_sqrt
S