LOG

Returns the base-10 logarithm of a numeric input.

Signature

    ┌─────────┐
IN ─┤   LOG   ├─ OUT
    └─────────┘
FUNCTION LOG : ANY_REAL
  VAR_INPUT
    IN : ANY_REAL;
  END_VAR
END_FUNCTION

The return type matches the input type. LOG accepts REAL, LREAL.

Inputs

Name

Type

Description

IN

ANY_REAL

The positive value to compute the base-10 logarithm of.

Outputs

Name

Type

Description

Return value

ANY_REAL

The base-10 logarithm of IN. Same type as IN.

Description

Returns the common logarithm (base 10) of IN. The input must be positive; the result of LOG applied to zero or a negative value is undefined.

Example

result := LOG(REAL#100.0);  (* result = 2.0 *)
value := LOG(LREAL#1000.0); (* value = 3.0 *)

See Also

  • LN — natural logarithm

  • EXP — natural exponential

References