Returns Log base 2 of the input.
LOG2(val)
(s, n) = LOG2(val)
val |
- |
A scalar, series or table. |
A real, series or table, log base 2 of the input.
(s, n) = LOG2(val) returns s and n such that
log2(1024)
returns 10.
log2({2, 4, 8, 16})
returns the series {1, 2, 3, 4}.
(s, n) = log2(3)
s == 0.75
n == 2
s * 2^n == 3
W1: (s, n) = log2({1..5});ravel(s, n, s * 2^n)
W1 == {{0.5, 1.0, 1.0},
{0.5, 2.0, 2.0},
{0.75, 2.0, 3.0},
{0.5, 3.0, 4.0},
{0.625, 3.0, 5.0}}
LOG2 is useful for manipulating the lengths of FFT calculations.