---
title: math package
description: The math package provides basic constants and mathematical functions.
url: https://docs.influxdata.com/flux/v0/stdlib/math/
estimated_tokens: 2093
product: Flux
version: v0
---

# math package

-   Flux 0.22.0+
-   View InfluxDB support

The `math` package provides basic constants and mathematical functions. Import the `math` package:

```js
import "math"
```

## Constants

```js
math.e
math.ln10
math.ln2
math.log10e
math.log2e
math.maxfloat
math.maxint
math.maxuint
math.minint
math.phi
math.pi
math.smallestNonzeroFloat
math.sqrt2
math.sqrte
math.sqrtphi
math.sqrtpi
```

-   **math.e** represents the base of the natural logarithm, also known as Euler’s number.
-   **math.ln10** represents the natural logarithm of 10.
-   **math.ln2** represents the natural logarithm of 2.
-   **math.log10e** represents the base 10 logarithm of **e** (`math.e`).
-   **math.log2e** represents the base 2 logarithm of **e** (`math.e`).
-   **math.maxfloat** represents the maximum float value.
-   **math.maxint** represents the maximum integer value (`2^63 - 1`).
-   **math.maxuint** represents the maximum unsigned integer value (`2^64 - 1`).
-   **math.minint** represents the minimum integer value (`-2^63`).
-   **math.phi** represents the [Golden Ratio](https://www.britannica.com/science/golden-ratio).
-   **math.pi** represents pi (π).
-   **math.smallestNonzeroFloat** represents the smallest nonzero float value.
-   **math.sqrt2** represents the square root of 2.
-   **math.sqrte** represents the square root of **e** (`math.e`).
-   **math.sqrtphi** represents the square root of phi (`math.phi`), the Golden Ratio.
-   **math.sqrtpi** represents the square root of pi (π).

## Functions

-   [math.abs()](/flux/v0/stdlib/math/abs/)
-   [math.acos()](/flux/v0/stdlib/math/acos/)
-   [math.acosh()](/flux/v0/stdlib/math/acosh/)
-   [math.asin()](/flux/v0/stdlib/math/asin/)
-   [math.asinh()](/flux/v0/stdlib/math/asinh/)
-   [math.atan()](/flux/v0/stdlib/math/atan/)
-   [math.atan2()](/flux/v0/stdlib/math/atan2/)
-   [math.atanh()](/flux/v0/stdlib/math/atanh/)
-   [math.cbrt()](/flux/v0/stdlib/math/cbrt/)
-   [math.ceil()](/flux/v0/stdlib/math/ceil/)
-   [math.copysign()](/flux/v0/stdlib/math/copysign/)
-   [math.cos()](/flux/v0/stdlib/math/cos/)
-   [math.cosh()](/flux/v0/stdlib/math/cosh/)
-   [math.dim()](/flux/v0/stdlib/math/dim/)
-   [math.erf()](/flux/v0/stdlib/math/erf/)
-   [math.erfc()](/flux/v0/stdlib/math/erfc/)
-   [math.erfcinv()](/flux/v0/stdlib/math/erfcinv/)
-   [math.erfinv()](/flux/v0/stdlib/math/erfinv/)
-   [math.exp()](/flux/v0/stdlib/math/exp/)
-   [math.exp2()](/flux/v0/stdlib/math/exp2/)
-   [math.expm1()](/flux/v0/stdlib/math/expm1/)
-   [math.float64bits()](/flux/v0/stdlib/math/float64bits/)
-   [math.float64frombits()](/flux/v0/stdlib/math/float64frombits/)
-   [math.floor()](/flux/v0/stdlib/math/floor/)
-   [math.frexp()](/flux/v0/stdlib/math/frexp/)
-   [math.gamma()](/flux/v0/stdlib/math/gamma/)
-   [math.hypot()](/flux/v0/stdlib/math/hypot/)
-   [math.ilogb()](/flux/v0/stdlib/math/ilogb/)
-   [math.isInf()](/flux/v0/stdlib/math/isinf/)
-   [math.isNaN()](/flux/v0/stdlib/math/isnan/)
-   [math.j0()](/flux/v0/stdlib/math/j0/)
-   [math.j1()](/flux/v0/stdlib/math/j1/)
-   [math.jn()](/flux/v0/stdlib/math/jn/)
-   [math.ldexp()](/flux/v0/stdlib/math/ldexp/)
-   [math.lgamma()](/flux/v0/stdlib/math/lgamma/)
-   [math.log()](/flux/v0/stdlib/math/log/)
-   [math.log10()](/flux/v0/stdlib/math/log10/)
-   [math.log1p()](/flux/v0/stdlib/math/log1p/)
-   [math.log2()](/flux/v0/stdlib/math/log2/)
-   [math.logb()](/flux/v0/stdlib/math/logb/)
-   [math.mInf()](/flux/v0/stdlib/math/minf/)
-   [math.mMax()](/flux/v0/stdlib/math/mmax/)
-   [math.mMin()](/flux/v0/stdlib/math/mmin/)
-   [math.mod()](/flux/v0/stdlib/math/mod/)
-   [math.modf()](/flux/v0/stdlib/math/modf/)
-   [math.NaN()](/flux/v0/stdlib/math/nan/)
-   [math.nextafter()](/flux/v0/stdlib/math/nextafter/)
-   [math.pow()](/flux/v0/stdlib/math/pow/)
-   [math.pow10()](/flux/v0/stdlib/math/pow10/)
-   [math.remainder()](/flux/v0/stdlib/math/remainder/)
-   [math.round()](/flux/v0/stdlib/math/round/)
-   [math.roundtoeven()](/flux/v0/stdlib/math/roundtoeven/)
-   [math.signbit()](/flux/v0/stdlib/math/signbit/)
-   [math.sin()](/flux/v0/stdlib/math/sin/)
-   [math.sincos()](/flux/v0/stdlib/math/sincos/)
-   [math.sinh()](/flux/v0/stdlib/math/sinh/)
-   [math.sqrt()](/flux/v0/stdlib/math/sqrt/)
-   [math.tan()](/flux/v0/stdlib/math/tan/)
-   [math.tanh()](/flux/v0/stdlib/math/tanh/)
-   [math.trunc()](/flux/v0/stdlib/math/trunc/)
-   [math.y0()](/flux/v0/stdlib/math/y0/)
-   [math.y1()](/flux/v0/stdlib/math/y1/)
-   [math.yn()](/flux/v0/stdlib/math/yn/)
