Skip to content

log

relationalai.semantics.std.math
log(x: NumberValue, base: NumberValue | None = None) -> Expression

Compute the logarithm with optional base.

  • x

    (NumberValue) - The positive input value. If the input value is not statically known to be non-positive, but turns out to be non-positive at runtime, returns NaN.
  • base

    (NumberValue | None, default: None) - The logarithm base. If None, computes natural log. Default: None.
  • Expression - An Expression computing log_base(x), or ln(x) if base is None. Returns Float.
  • ValueError - If x can be computed statically and is non-positive.

Compute logarithm:

>>> select(math.log(100, 10))
>>> select(math.log(Signal.amplitude))