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 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