math package
math
包提供基本的常量和数学函数。导入 math
包
import "math"
常量
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 表示自然对数的底数,也称为欧拉数。
- math.ln10 表示 10 的自然对数。
- math.ln2 表示 2 的自然对数。
- math.log10e 表示 e (
math.e
) 的以 10 为底的对数。 - math.log2e 表示 e (
math.e
) 的以 2 为底的对数。 - math.maxfloat 表示最大浮点数值。
- math.maxint 表示最大整数值 (
2^63 - 1
)。 - math.maxuint 表示最大无符号整数值 (
2^64 - 1
)。 - math.minint 表示最小整数值 (
-2^63
)。 - math.phi 表示黄金比例。
- math.pi 表示 pi (π)。
- math.smallestNonzeroFloat 表示最小非零浮点数值。
- math.sqrt2 表示 2 的平方根。
- math.sqrte 表示 e (
math.e
) 的平方根。 - math.sqrtphi 表示 phi (
math.phi
),即黄金比例的平方根。 - math.sqrtpi 表示 pi (π) 的平方根。
函数
- 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()
此页是否对您有帮助?
感谢您的反馈!