LOG

Elemental Intrinsic Function (Generic): Returns the natural logarithm of the argument.

Syntax

result = LOG (x)

x
(Input) Must be of type real or complex. If x is real, its value must be greater than zero. If x is complex, its value must not be zero.

Results

The result type is the same as x. The result value is approximately equal to logex.

If the arguments are complex, the result is the principal value of imaginary part omega in the range -pi < omega pi. The imaginary part of the result is pi if the real part of the argument is less than zero and the imaginary part of the argument is zero.

Specific Name Argument Type Result Type
ALOG 1,2 REAL(4) REAL(4)
DLOG REAL(8) REAL(8)
QLOG REAL(16) REAL(16)
CLOG 2 COMPLEX(4) COMPLEX(4)
CDLOG 3 COMPLEX(8) COMPLEX(8)
CQLOG COMPLEX(16) COMPLEX(16)
1 This function can also be specified as LOG.
2 The setting of compiler options specifying real size can affect ALOG, LOG, and CLOG.
3 This function can also be specified as ZLOG.

See Also

EXP, LOG10

Examples

LOG (8.0) has the value 2.079442.

LOG (25.0) has the value 3.218876.

The following shows another example:

REAL r
r = LOG(10.0)  ! returns 2.302585