# log2 {#log2}

**Parent topic:**[Functions](../../Functions/category.md)

## Syntax {#syntax}

`log2(X)`

## Arguments {#arguments}

**X** is a scalar/vector/matrix/table.

## Details {#details}

Return the logarithm of *X* to the base 2.

## Examples {#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|

