Documentation

math.expm1() function

math.expm1() returns e**x - 1, the base-e exponential of x minus 1. It is more accurate than math.exp(x:x) - 1 when x is near zero.

Function type signature
(x: float) => float
For more information, see Function type signatures.

Parameters

x

(Required) Value to operate on.

Examples

Get more accurate base-e exponentials for values near zero

import "math"

math.expm1(x: 0.022)// 0.022243784470438233

Use math.expm1 in map

import "math"

data
    |> map(fn: (r) => ({r with _value: math.expm1(x: r._value)}))

View example input and ouput


Was this page helpful?

Thank you for your feedback!


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.