Back to Influxdb

math.acosh() function

content/flux/v0/stdlib/math/acosh.md

latest3.3 KB
Original Source
<!------------------------------------------------------------------------------ IMPORTANT: This page was generated from comments in the Flux source code. Any edits made directly to this page will be overwritten the next time the documentation is generated. To make updates to this documentation, update the function comments above the function definition in the Flux source code: https://github.com/influxdata/flux/blob/master/stdlib/math/math.flux#L160-L160 Contributing to Flux: https://github.com/influxdata/flux#contributing Fluxdoc syntax: https://github.com/influxdata/flux/blob/master/docs/fluxdoc.md ------------------------------------------------------------------------------->

math.acosh() returns the inverse hyperbolic cosine of x.

Function type signature
js
(x: float) => float

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

Parameters

x

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

x should be greater than 1. If less than 1 the operation will return NaN.

Examples

Return the inverse hyperbolic cosine of a value

js
import "math"

math.acosh(x: 1.22)

Use math.acosh in map

js
import "math"

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

{{< expand-wrapper >}} {{% expand "View example input and output" %}}

Input data

_time*tag_value
2021-01-01T00:00:00Zt1-0.21800000000000003
2021-01-01T00:00:10Zt11.092
2021-01-01T00:00:20Zt10.735
2021-01-01T00:00:30Zt11.7530000000000001
2021-01-01T00:00:40Zt11.5230000000000001
2021-01-01T00:00:50Zt10.443
_time*tag_value
2021-01-01T00:00:00Zt21.9850000000000003
2021-01-01T00:00:10Zt20.497
2021-01-01T00:00:20Zt2-0.375
2021-01-01T00:00:30Zt21.977
2021-01-01T00:00:40Zt21.3860000000000001
2021-01-01T00:00:50Zt20.18600000000000003

Output data

_time_value*tag
2021-01-01T00:00:00ZNaNt1
2021-01-01T00:00:10Z0.42572984537574377t1
2021-01-01T00:00:20ZNaNt1
2021-01-01T00:00:30Z1.1608966388962805t1
2021-01-01T00:00:40Z0.9827177940622978t1
2021-01-01T00:00:50ZNaNt1
_time_value*tag
2021-01-01T00:00:00Z1.308254013849232t2
2021-01-01T00:00:10ZNaNt2
2021-01-01T00:00:20ZNaNt2
2021-01-01T00:00:30Z1.3035758471451702t2
2021-01-01T00:00:40Z0.8525776257667146t2
2021-01-01T00:00:50ZNaNt2

{{% /expand %}} {{< /expand-wrapper >}}