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 REAL(4) REAL(4)
DLOG REAL(8) REAL(8)
QLOG 2 REAL(16) REAL(16)
CLOG 1 COMPLEX(4) COMPLEX(4)
CDLOG 3 COMPLEX(8) COMPLEX(8)
CQLOG 2 COMPLEX(16) COMPLEX(16)
1 The setting of compiler option /real_size can affect ALOG and CLOG.
2 VMS and U*X
3 This function can also be specified as ZLOG.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

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