Reference to the log2() function
Summary
log2(<tsExpression>)
Returns the logarithm base 2 of each data value described by the expression.
Parameters
Parameter | Description |
---|---|
tsExpression | Expression describing a constant or a time series of values to take the logarithm of. |
Description
The log2()
function produces a time series in which each data value is equal to the binary logarithm (log base 2) of the value or values specified by the expression. The binary logarithm is the power to which you need to raise 2 to obtain the value of the expression.
- If
tsExpression
describes a constant valueN
, thenlog2()
returns a continuous series where every data value islog2 N
. - If
tsExpression
describes one or more time series, thenlog2()
returns a new time series for each input time series. Each value in a new time series is calculated aslog2 V
, whereV
is the value of the corresponding point in the input time series.
By default, the chart legend displays a rounded version of the result. You can cause the legend to display the result with more precision by holding down the shift key when you hover over the time series.
Examples
Here we see the result (in orange) of using log2()
to take the binary log of a time series (in purple).