math package
The math
package provides basic constants and mathematical functions.
Import the math
package:
import "math"
Constants
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.
- 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()
- math.acos()
- math.acosh()
- math.asin()
- math.asinh()
- math.atan()
- math.atan2()
- math.atanh()
- math.cbrt()
- math.ceil()
- math.copysign()
- math.cos()
- math.cosh()
- math.dim()
- math.erf()
- math.erfc()
- math.erfcinv()
- math.erfinv()
- math.exp()
- math.exp2()
- math.expm1()
- math.float64bits()
- math.float64frombits()
- math.floor()
- math.frexp()
- math.gamma()
- math.hypot()
- math.ilogb()
- math.isInf()
- math.isNaN()
- math.j0()
- math.j1()
- math.jn()
- math.ldexp()
- math.lgamma()
- math.log()
- math.log10()
- math.log1p()
- math.log2()
- math.logb()
- math.mInf()
- math.mMax()
- math.mMin()
- math.mod()
- math.modf()
- math.NaN()
- math.nextafter()
- math.pow()
- math.pow10()
- math.remainder()
- math.round()
- math.roundtoeven()
- math.signbit()
- math.sin()
- math.sincos()
- math.sinh()
- math.sqrt()
- math.tan()
- math.tanh()
- math.trunc()
- math.y0()
- math.y1()
- math.yn()
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.