Elemental Intrinsic Function (Generic): Returns the natural logarithm of the argument.
Syntax
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
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