Documentation

math.log2() function

math.log2() is a function returns the binary logarithm of x.

Function type signature
(x: float) => float

For more information, see Function type signatures.

Parameters

x

(Required) the value used in the operation.

Examples

Return the binary logarithm of a value

import "math"

math.log2(x: 3.14)// 1.6507645591169022

Use math.log2 in map

import "sampledata"
import "math"

sampledata.float()
    |> map(fn: (r) => ({r with _value: math.log2(x: r._value)}))

View example input and output


Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more