---
title: math.log2
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/functions/math-logexp/math-log2
---

```
FLOAT math.log2(FLOAT x)
```

**Available in:** all subroutines

Computes the base 2 logarithm of the input `x`.

## Example

```vcl
sub vcl_deliver {
  declare local var.foo FLOAT;
  set var.foo = math.log2(4294967296); # result: 32.0
}
```
