Skip to content

log2 - Calculate log to base 2

log2 is a shorthand for computing log(2, number). It calculates the log, to base 2, for a given value.

Syntax

log2(number: number): number

Arguments

NameTypeRequiredDescription
numbernumbertrueThe value whose logarithm we wish to find

Example - Basic usage

The log2 command is simple and intuitive to use:

create log_field from log2(some_value)

This command will create a new field, log_field which is equal to the log to base 2 of some_value.

NOTE: some_value MUST be a numerical type.