LOG Function

Computes a base, b, logarithm of an array, x, which is equal to the inverse of the function f(x) = bx.

Usage

    result = log(x, b)

Input Parameters

x—A vector of positive numbers of any real or complex data type.

b—A positive scalar number, not equal to 1, specifying the base of the logarithm.

Returned Value

result—The base, b, logarithm of x.

Keywords

Natural—If set and nonzero, the b input argument is overridden and the base is set to e.

Discussion

LOG is defined as:

    y = log(x, b)

Floating-point and complex values return a result with the same data type (FLOAT, DOUBLE, COMPLEX, DCOMPLEX). All other data types are converted to single-precision, floating-point values and yield a floating-point result.

LOG handles complex numbers in the following way:

    Log(x) = Complex(log(base b) of (|x|, arctan(x)))

Example

b = 3
x = (FINDGEN(8)+1)/8
y = LOG(x, b)
PM, [[x],[y],[b^y]]
; PV-WAVE prints:
;     0.125000     -1.89279     0.125000
;     0.250000     -1.26186     0.250000
;     0.375000    -0.892789     0.375000
;     0.500000    -0.630930     0.500000
;     0.625000    -0.427816     0.625000
;     0.750000    -0.261860     0.750000
;     0.875000    -0.121546     0.875000
;      1.00000      0.00000      1.00000

See Also

ALOG,  ALOG10

For more information, see the PV‑WAVE User Guide.