sqrt

Date:

02-06-2023

NAME

SQRT, DSQRT, CSQRT, CDSQRT - Compute square root

SYNOPSIS

SQRT ([X=]x)
DSQRT ([X=]x)
CSQRT ([X=]x)
CDSQRT ([X=]x)

STANDARDS

Fortran

Fortran extension: CDSQRT

DESCRIPTION

The SQRT, DSQRT, CSQRT, and CDSQRT intrinsic functions compute the square root of their arguments.

These functions evaluate y = x1/2.

SQRT is the generic function name; the others are specifics. These are elemental intrinsic functions. They accept the following argument:

x

Must be of type real or complex. If i is of type real, it must be greater than or equal to zero.

NOTES

The SQRT, DSQRT, and CSQRT intrinsic function names can be passed as arguments; the others cannot. The following return values occur:

  • SQRT(0) yields 0.

  • SQRT(-0) yields -0.

  • If x < 0, SQRT(x) yields NaN.

  • SQRT(NaN) yields NaN.

  • SQRT(infinity) yields infinity.

Note: The sqrt() and csqrt() functions have Linux-equivalent names. Use the man -aname option to show all manual pages matching name within the MANPATH search path. Manual pages are displayed in the order found.

RETURN VALUES

SQRT returns the real square root of its real argument.

DSQRT returns the double-precision square root of its double-precision argument.

CSQRT returns the complex square root of its complex argument.

CDSQRT returns the double-precision complex square root of its double-precision complex argument.