log2

Syntax

log2(X)

Parameters

X is a scalar/vector/matrix/table.

Details

Returns the logarithm of X to the base 2.

Note:

DolphinDB log2 and numpy.log2 provide the same core functionality. The difference is that DolphinDB log2 accepts only one parameter, X, whereas numpy.log2 supports additional parameters such as out and where.

Examples

log2(4);
// output: 2

log2(0 2 4 8 NULL);
// output: [,1,2,3,]

log2(1..4$2:2);
#0 #1
0 1.584963
1 2