Skip to content

log2

relationalai.semantics.std.math
log2(value: NumberValue) -> Expression

Compute the base-2 logarithm.

  • value

    (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.
  • Expression - An Expression computing log_2(value). Returns Float.
  • ValueError - If x can be computed statically and is non-positive.

Compute base-2 logarithm:

>>> select(math.log2(1024))
>>> select(math.log2(Data.size))