docs-v2/content/flux/v0/stdlib/math/log.md

1.6 KiB

title description menu weight
math.log() function `math.log()` returns the natural logarithm of `x`.
flux_v0_ref
name parent identifier
math.log math math/log
101

math.log() returns the natural logarithm of x.

Function type signature
(x: float) => float

{{% caption %}} For more information, see Function type signatures. {{% /caption %}}

Parameters

x

({{< req >}}) Value to operate on.

Examples

Return the natural logarithm of a value

import "math"

math.log(x: 3.14)// 1.144222799920162


Use math.log in map

import "sampledata"
import "math"

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