Next: , Previous: , Up: Intrinsic Procedures   [Contents][Index]


9.175 LOG — Natural logarithm function

Description:

LOG(X) computes the natural logarithm of X, i.e. the logarithm to the base e.

Standard:

Fortran 77 and later

Class:

Elemental function

Syntax:

RESULT = LOG(X)

Arguments:
XThe 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. If X is COMPLEX, the imaginary part \omega is in the range -\pi < \omega \leq \pi.

Example:
program test_log
  real(8) :: x = 2.7182818284590451_8
  complex :: z = (1.0, 2.0)
  x = log(x)    ! will yield (approximately) 1
  z = log(z)
end program test_log
Specific names:
NameArgumentReturn typeStandard
ALOG(X)REAL(4) XREAL(4)f95, gnu
DLOG(X)REAL(8) XREAL(8)f95, gnu
CLOG(X)COMPLEX(4) XCOMPLEX(4)f95, gnu
ZLOG(X)COMPLEX(8) XCOMPLEX(8)f95, gnu
CDLOG(X)COMPLEX(8) XCOMPLEX(8)f95, gnu