Skip to content

Compute hyperbolic cosine

Source code

Description

Compute hyperbolic cosine

Usage

<Expr>$cosh()

Value

Expr

Examples

library("polars")

pl$DataFrame(a = c(-1, acosh(2), 0, 1, NA_real_))$
  with_columns(cosh = pl$col("a")$cosh())
#> shape: (5, 2)
#> ┌──────────┬──────────┐
#> │ a        ┆ cosh     │
#> │ ---      ┆ ---      │
#> │ f64      ┆ f64      │
#> ╞══════════╪══════════╡
#> │ -1.0     ┆ 1.543081 │
#> │ 1.316958 ┆ 2.0      │
#> │ 0.0      ┆ 1.0      │
#> │ 1.0      ┆ 1.543081 │
#> │ null     ┆ null     │
#> └──────────┴──────────┘