Previous Topic: LIKENext Topic: MODULO


LOGARITHM

Purpose

Returns the common (base 10) or natural (base E) logarithm of a numeric value.

Syntax

Logarithm (base 10)

►►─┬─ LOG-BASE-10 ─┬─ ( value ) ──────────────────────────────────────────────►◄
   ├─ COMLOG ──────┤
   ├─ LOGCOM ──────┤
   └─ LOG10 ───────┘

Logarithm (base E)

►►─┬─ LOG-BASE-E ─┬─ ( value ) ───────────────────────────────────────────────►◄
   ├─ NATLOG ─────┤
   ├─ LOGNAT ─────┤
   └─ LOGE ───────┘

Parameters

value

Specifies the numeric value whose logarithm is calculated. Value can be:

Value must be greater than zero.

Example

In the following example, the logarithm function is used to calculate the base-10 logarithm of a numeric value:

Initial value:
    WK-VALUE:  100
Statement:
    MOVE LOG-BASE-10(WK-VALUE) TO WK-LOG-EQUIVALENT.
Returned value:  2