Movatterモバイル変換


[0]ホーム

URL:


math

packagestandard library
go1.25.2Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2025 License:BSD-3-ClauseImports:3Imported by:585,202

Details

Repository

cs.opensource.google/go/go

Links

Documentation

Overview

Package math provides basic constants and mathematical functions.

This package does not guarantee bit-identical results across architectures.

Index

Examples

Constants

View Source
const (E   = 2.71828182845904523536028747135266249775724709369995957496696763//https://oeis.org/A001113Pi  = 3.14159265358979323846264338327950288419716939937510582097494459//https://oeis.org/A000796Phi = 1.61803398874989484820458683436563811772030917980576286213544862//https://oeis.org/A001622Sqrt2   = 1.41421356237309504880168872420969807856967187537694807317667974//https://oeis.org/A002193SqrtE   = 1.64872127070012814684865078781416357165377610071014801157507931//https://oeis.org/A019774SqrtPi  = 1.77245385090551602729816748334114518279754945612238712821380779//https://oeis.org/A002161SqrtPhi = 1.27201964951406896425242246173749149171560804184009624861664038//https://oeis.org/A139339Ln2    = 0.693147180559945309417232121458176568075500134360255254120680009//https://oeis.org/A002162Log2E  = 1 /Ln2Ln10   = 2.30258509299404568401799145468436420760110148862877297603332790//https://oeis.org/A002392Log10E = 1 /Ln10)

Mathematical constants.

View Source
const (MaxFloat32             = 0x1p127 * (1 + (1 - 0x1p-23))// 3.40282346638528859811704183484516925440e+38SmallestNonzeroFloat32 = 0x1p-126 * 0x1p-23// 1.401298464324817070923729583289916131280e-45MaxFloat64             = 0x1p1023 * (1 + (1 - 0x1p-52))// 1.79769313486231570814527423731704356798070e+308SmallestNonzeroFloat64 = 0x1p-1022 * 0x1p-52// 4.9406564584124654417656879286822137236505980e-324)

Floating-point limit values.Max is the largest finite value representable by the type.SmallestNonzero is the smallest positive, non-zero value representable by the type.

View Source
const (MaxInt    = 1<<(intSize-1) - 1// MaxInt32 or MaxInt64 depending on intSize.MinInt    = -1 << (intSize - 1)// MinInt32 or MinInt64 depending on intSize.MaxInt8   = 1<<7 - 1// 127MinInt8   = -1 << 7// -128MaxInt16  = 1<<15 - 1// 32767MinInt16  = -1 << 15// -32768MaxInt32  = 1<<31 - 1// 2147483647MinInt32  = -1 << 31// -2147483648MaxInt64  = 1<<63 - 1// 9223372036854775807MinInt64  = -1 << 63// -9223372036854775808MaxUint   = 1<<intSize - 1// MaxUint32 or MaxUint64 depending on intSize.MaxUint8  = 1<<8 - 1// 255MaxUint16 = 1<<16 - 1// 65535MaxUint32 = 1<<32 - 1// 4294967295MaxUint64 = 1<<64 - 1// 18446744073709551615)

Integer limit values.

Variables

This section is empty.

Functions

funcAbs

func Abs(xfloat64)float64

Abs returns the absolute value of x.

Special cases are:

Abs(±Inf) = +InfAbs(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {x := math.Abs(-2)fmt.Printf("%.1f\n", x)y := math.Abs(2)fmt.Printf("%.1f\n", y)}
Output:2.02.0

funcAcos

func Acos(xfloat64)float64

Acos returns the arccosine, in radians, of x.

Special case is:

Acos(x) = NaN if x < -1 or x > 1
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Acos(1))}
Output:0.00

funcAcosh

func Acosh(xfloat64)float64

Acosh returns the inverse hyperbolic cosine of x.

Special cases are:

Acosh(+Inf) = +InfAcosh(x) = NaN if x < 1Acosh(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Acosh(1))}
Output:0.00

funcAsin

func Asin(xfloat64)float64

Asin returns the arcsine, in radians, of x.

Special cases are:

Asin(±0) = ±0Asin(x) = NaN if x < -1 or x > 1
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Asin(0))}
Output:0.00

funcAsinh

func Asinh(xfloat64)float64

Asinh returns the inverse hyperbolic sine of x.

Special cases are:

Asinh(±0) = ±0Asinh(±Inf) = ±InfAsinh(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Asinh(0))}
Output:0.00

funcAtan

func Atan(xfloat64)float64

Atan returns the arctangent, in radians, of x.

Special cases are:

Atan(±0) = ±0Atan(±Inf) = ±Pi/2
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Atan(0))}
Output:0.00

funcAtan2

func Atan2(y, xfloat64)float64

Atan2 returns the arc tangent of y/x, usingthe signs of the two to determine the quadrantof the return value.

Special cases are (in order):

Atan2(y, NaN) = NaNAtan2(NaN, x) = NaNAtan2(+0, x>=0) = +0Atan2(-0, x>=0) = -0Atan2(+0, x<=-0) = +PiAtan2(-0, x<=-0) = -PiAtan2(y>0, 0) = +Pi/2Atan2(y<0, 0) = -Pi/2Atan2(+Inf, +Inf) = +Pi/4Atan2(-Inf, +Inf) = -Pi/4Atan2(+Inf, -Inf) = 3Pi/4Atan2(-Inf, -Inf) = -3Pi/4Atan2(y, +Inf) = 0Atan2(y>0, -Inf) = +PiAtan2(y<0, -Inf) = -PiAtan2(+Inf, x) = +Pi/2Atan2(-Inf, x) = -Pi/2
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Atan2(0, 0))}
Output:0.00

funcAtanh

func Atanh(xfloat64)float64

Atanh returns the inverse hyperbolic tangent of x.

Special cases are:

Atanh(1) = +InfAtanh(±0) = ±0Atanh(-1) = -InfAtanh(x) = NaN if x < -1 or x > 1Atanh(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Atanh(0))}
Output:0.00

funcCbrt

func Cbrt(xfloat64)float64

Cbrt returns the cube root of x.

Special cases are:

Cbrt(±0) = ±0Cbrt(±Inf) = ±InfCbrt(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f\n", math.Cbrt(8))fmt.Printf("%.2f\n", math.Cbrt(27))}
Output:2.003.00

funcCeil

func Ceil(xfloat64)float64

Ceil returns the least integer value greater than or equal to x.

Special cases are:

Ceil(±0) = ±0Ceil(±Inf) = ±InfCeil(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {c := math.Ceil(1.49)fmt.Printf("%.1f", c)}
Output:2.0

funcCopysign

func Copysign(f, signfloat64)float64

Copysign returns a value with the magnitude of fand the sign of sign.

Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Copysign(3.2, -1))}
Output:-3.20

funcCos

func Cos(xfloat64)float64

Cos returns the cosine of the radian argument x.

Special cases are:

Cos(±Inf) = NaNCos(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Cos(math.Pi/2))}
Output:0.00

funcCosh

func Cosh(xfloat64)float64

Cosh returns the hyperbolic cosine of x.

Special cases are:

Cosh(±0) = 1Cosh(±Inf) = +InfCosh(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Cosh(0))}
Output:1.00

funcDim

func Dim(x, yfloat64)float64

Dim returns the maximum of x-y or 0.

Special cases are:

Dim(+Inf, +Inf) = NaNDim(-Inf, -Inf) = NaNDim(x, NaN) = Dim(NaN, x) = NaN
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f\n", math.Dim(4, -2))fmt.Printf("%.2f\n", math.Dim(-4, 2))}
Output:6.000.00

funcErf

func Erf(xfloat64)float64

Erf returns the error function of x.

Special cases are:

Erf(+Inf) = 1Erf(-Inf) = -1Erf(NaN) = NaN

funcErfc

func Erfc(xfloat64)float64

Erfc returns the complementary error function of x.

Special cases are:

Erfc(+Inf) = 0Erfc(-Inf) = 2Erfc(NaN) = NaN

funcErfcinvadded ingo1.10

func Erfcinv(xfloat64)float64

Erfcinv returns the inverse ofErfc(x).

Special cases are:

Erfcinv(0) = +InfErfcinv(2) = -InfErfcinv(x) = NaN if x < 0 or x > 2Erfcinv(NaN) = NaN

funcErfinvadded ingo1.10

func Erfinv(xfloat64)float64

Erfinv returns the inverse error function of x.

Special cases are:

Erfinv(1) = +InfErfinv(-1) = -InfErfinv(x) = NaN if x < -1 or x > 1Erfinv(NaN) = NaN

funcExp

func Exp(xfloat64)float64

Exp returns e**x, the base-e exponential of x.

Special cases are:

Exp(+Inf) = +InfExp(NaN) = NaN

Very large values overflow to 0 or +Inf.Very small values underflow to 1.

Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f\n", math.Exp(1))fmt.Printf("%.2f\n", math.Exp(2))fmt.Printf("%.2f\n", math.Exp(-1))}
Output:2.727.390.37

funcExp2

func Exp2(xfloat64)float64

Exp2 returns 2**x, the base-2 exponential of x.

Special cases are the same asExp.

Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f\n", math.Exp2(1))fmt.Printf("%.2f\n", math.Exp2(-3))}
Output:2.000.12

funcExpm1

func Expm1(xfloat64)float64

Expm1 returns e**x - 1, the base-e exponential of x minus 1.It is more accurate thanExp(x) - 1 when x is near zero.

Special cases are:

Expm1(+Inf) = +InfExpm1(-Inf) = -1Expm1(NaN) = NaN

Very large values overflow to -1 or +Inf.

Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.6f\n", math.Expm1(0.01))fmt.Printf("%.6f\n", math.Expm1(-1))}
Output:0.010050-0.632121

funcFMAadded ingo1.14

func FMA(x, y, zfloat64)float64

FMA returns x * y + z, computed with only one rounding.(That is, FMA returns the fused multiply-add of x, y, and z.)

funcFloat32bits

func Float32bits(ffloat32)uint32

Float32bits returns the IEEE 754 binary representation of f,with the sign bit of f and the result in the same bit position.Float32bits(Float32frombits(x)) == x.

funcFloat32frombits

func Float32frombits(buint32)float32

Float32frombits returns the floating-point number correspondingto the IEEE 754 binary representation b, with the sign bit of band the result in the same bit position.Float32frombits(Float32bits(x)) == x.

funcFloat64bits

func Float64bits(ffloat64)uint64

Float64bits returns the IEEE 754 binary representation of f,with the sign bit of f and the result in the same bit position,and Float64bits(Float64frombits(x)) == x.

funcFloat64frombits

func Float64frombits(buint64)float64

Float64frombits returns the floating-point number correspondingto the IEEE 754 binary representation b, with the sign bit of band the result in the same bit position.Float64frombits(Float64bits(x)) == x.

funcFloor

func Floor(xfloat64)float64

Floor returns the greatest integer value less than or equal to x.

Special cases are:

Floor(±0) = ±0Floor(±Inf) = ±InfFloor(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {c := math.Floor(1.51)fmt.Printf("%.1f", c)}
Output:1.0

funcFrexp

func Frexp(ffloat64) (fracfloat64, expint)

Frexp breaks f into a normalized fractionand an integral power of two.It returns frac and exp satisfying f == frac × 2**exp,with the absolute value of frac in the interval [½, 1).

Special cases are:

Frexp(±0) = ±0, 0Frexp(±Inf) = ±Inf, 0Frexp(NaN) = NaN, 0

funcGamma

func Gamma(xfloat64)float64

Gamma returns the Gamma function of x.

Special cases are:

Gamma(+Inf) = +InfGamma(+0) = +InfGamma(-0) = -InfGamma(x) = NaN for integer x < 0Gamma(-Inf) = NaNGamma(NaN) = NaN

funcHypot

func Hypot(p, qfloat64)float64

Hypot returnsSqrt(p*p + q*q), taking care to avoidunnecessary overflow and underflow.

Special cases are:

Hypot(±Inf, q) = +InfHypot(p, ±Inf) = +InfHypot(NaN, q) = NaNHypot(p, NaN) = NaN

funcIlogb

func Ilogb(xfloat64)int

Ilogb returns the binary exponent of x as an integer.

Special cases are:

Ilogb(±Inf) = MaxInt32Ilogb(0) = MinInt32Ilogb(NaN) = MaxInt32

funcInf

func Inf(signint)float64

Inf returns positive infinity if sign >= 0, negative infinity if sign < 0.

funcIsInf

func IsInf(ffloat64, signint)bool

IsInf reports whether f is an infinity, according to sign.If sign > 0, IsInf reports whether f is positive infinity.If sign < 0, IsInf reports whether f is negative infinity.If sign == 0, IsInf reports whether f is either infinity.

funcIsNaN

func IsNaN(ffloat64) (isbool)

IsNaN reports whether f is an IEEE 754 “not-a-number” value.

funcJ0

func J0(xfloat64)float64

J0 returns the order-zero Bessel function of the first kind.

Special cases are:

J0(±Inf) = 0J0(0) = 1J0(NaN) = NaN

funcJ1

func J1(xfloat64)float64

J1 returns the order-one Bessel function of the first kind.

Special cases are:

J1(±Inf) = 0J1(NaN) = NaN

funcJn

func Jn(nint, xfloat64)float64

Jn returns the order-n Bessel function of the first kind.

Special cases are:

Jn(n, ±Inf) = 0Jn(n, NaN) = NaN

funcLdexp

func Ldexp(fracfloat64, expint)float64

Ldexp is the inverse ofFrexp.It returns frac × 2**exp.

Special cases are:

Ldexp(±0, exp) = ±0Ldexp(±Inf, exp) = ±InfLdexp(NaN, exp) = NaN

funcLgamma

func Lgamma(xfloat64) (lgammafloat64, signint)

Lgamma returns the natural logarithm and sign (-1 or +1) ofGamma(x).

Special cases are:

Lgamma(+Inf) = +InfLgamma(0) = +InfLgamma(-integer) = +InfLgamma(-Inf) = -InfLgamma(NaN) = NaN

funcLog

func Log(xfloat64)float64

Log returns the natural logarithm of x.

Special cases are:

Log(+Inf) = +InfLog(0) = -InfLog(x < 0) = NaNLog(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {x := math.Log(1)fmt.Printf("%.1f\n", x)y := math.Log(2.7183)fmt.Printf("%.1f\n", y)}
Output:0.01.0

funcLog10

func Log10(xfloat64)float64

Log10 returns the decimal logarithm of x.The special cases are the same as forLog.

Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.1f", math.Log10(100))}
Output:2.0

funcLog1p

func Log1p(xfloat64)float64

Log1p returns the natural logarithm of 1 plus its argument x.It is more accurate thanLog(1 + x) when x is near zero.

Special cases are:

Log1p(+Inf) = +InfLog1p(±0) = ±0Log1p(-1) = -InfLog1p(x < -1) = NaNLog1p(NaN) = NaN

funcLog2

func Log2(xfloat64)float64

Log2 returns the binary logarithm of x.The special cases are the same as forLog.

Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.1f", math.Log2(256))}
Output:8.0

funcLogb

func Logb(xfloat64)float64

Logb returns the binary exponent of x.

Special cases are:

Logb(±Inf) = +InfLogb(0) = -InfLogb(NaN) = NaN

funcMax

func Max(x, yfloat64)float64

Max returns the larger of x or y.

Special cases are:

Max(x, +Inf) = Max(+Inf, x) = +InfMax(x, NaN) = Max(NaN, x) = NaNMax(+0, ±0) = Max(±0, +0) = +0Max(-0, -0) = -0

Note that this differs from the built-in function max when calledwith NaN and +Inf.

funcMin

func Min(x, yfloat64)float64

Min returns the smaller of x or y.

Special cases are:

Min(x, -Inf) = Min(-Inf, x) = -InfMin(x, NaN) = Min(NaN, x) = NaNMin(-0, ±0) = Min(±0, -0) = -0

Note that this differs from the built-in function min when calledwith NaN and -Inf.

funcMod

func Mod(x, yfloat64)float64

Mod returns the floating-point remainder of x/y.The magnitude of the result is less than y and itssign agrees with that of x.

Special cases are:

Mod(±Inf, y) = NaNMod(NaN, y) = NaNMod(x, 0) = NaNMod(x, ±Inf) = xMod(x, NaN) = NaN
Example
package mainimport ("fmt""math")func main() {c := math.Mod(7, 4)fmt.Printf("%.1f", c)}
Output:3.0

funcModf

func Modf(ffloat64) (intfloat64, fracfloat64)

Modf returns integer and fractional floating-point numbersthat sum to f. Both values have the same sign as f.

Special cases are:

Modf(±Inf) = ±Inf, NaNModf(NaN) = NaN, NaN
Example
package mainimport ("fmt""math")func main() {int, frac := math.Modf(3.14)fmt.Printf("%.2f, %.2f\n", int, frac)int, frac = math.Modf(-2.71)fmt.Printf("%.2f, %.2f\n", int, frac)}
Output:3.00, 0.14-2.00, -0.71

funcNaN

func NaN()float64

NaN returns an IEEE 754 “not-a-number” value.

funcNextafter

func Nextafter(x, yfloat64) (rfloat64)

Nextafter returns the next representable float64 value after x towards y.

Special cases are:

Nextafter(x, x)   = xNextafter(NaN, y) = NaNNextafter(x, NaN) = NaN

funcNextafter32added ingo1.4

func Nextafter32(x, yfloat32) (rfloat32)

Nextafter32 returns the next representable float32 value after x towards y.

Special cases are:

Nextafter32(x, x)   = xNextafter32(NaN, y) = NaNNextafter32(x, NaN) = NaN

funcPow

func Pow(x, yfloat64)float64

Pow returns x**y, the base-x exponential of y.

Special cases are (in order):

Pow(x, ±0) = 1 for any xPow(1, y) = 1 for any yPow(x, 1) = x for any xPow(NaN, y) = NaNPow(x, NaN) = NaNPow(±0, y) = ±Inf for y an odd integer < 0Pow(±0, -Inf) = +InfPow(±0, +Inf) = +0Pow(±0, y) = +Inf for finite y < 0 and not an odd integerPow(±0, y) = ±0 for y an odd integer > 0Pow(±0, y) = +0 for finite y > 0 and not an odd integerPow(-1, ±Inf) = 1Pow(x, +Inf) = +Inf for |x| > 1Pow(x, -Inf) = +0 for |x| > 1Pow(x, +Inf) = +0 for |x| < 1Pow(x, -Inf) = +Inf for |x| < 1Pow(+Inf, y) = +Inf for y > 0Pow(+Inf, y) = +0 for y < 0Pow(-Inf, y) = Pow(-0, -y)Pow(x, y) = NaN for finite x < 0 and finite non-integer y
Example
package mainimport ("fmt""math")func main() {c := math.Pow(2, 3)fmt.Printf("%.1f", c)}
Output:8.0

funcPow10

func Pow10(nint)float64

Pow10 returns 10**n, the base-10 exponential of n.

Special cases are:

Pow10(n) =    0 for n < -323Pow10(n) = +Inf for n > 308
Example
package mainimport ("fmt""math")func main() {c := math.Pow10(2)fmt.Printf("%.1f", c)}
Output:100.0

funcRemainder

func Remainder(x, yfloat64)float64

Remainder returns the IEEE 754 floating-point remainder of x/y.

Special cases are:

Remainder(±Inf, y) = NaNRemainder(NaN, y) = NaNRemainder(x, 0) = NaNRemainder(x, ±Inf) = xRemainder(x, NaN) = NaN
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.1f", math.Remainder(100, 30))}
Output:10.0

funcRoundadded ingo1.10

func Round(xfloat64)float64

Round returns the nearest integer, rounding half away from zero.

Special cases are:

Round(±0) = ±0Round(±Inf) = ±InfRound(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {p := math.Round(10.5)fmt.Printf("%.1f\n", p)n := math.Round(-10.5)fmt.Printf("%.1f\n", n)}
Output:11.0-11.0

funcRoundToEvenadded ingo1.10

func RoundToEven(xfloat64)float64

RoundToEven returns the nearest integer, rounding ties to even.

Special cases are:

RoundToEven(±0) = ±0RoundToEven(±Inf) = ±InfRoundToEven(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {u := math.RoundToEven(11.5)fmt.Printf("%.1f\n", u)d := math.RoundToEven(12.5)fmt.Printf("%.1f\n", d)}
Output:12.012.0

funcSignbit

func Signbit(xfloat64)bool

Signbit reports whether x is negative or negative zero.

funcSin

func Sin(xfloat64)float64

Sin returns the sine of the radian argument x.

Special cases are:

Sin(±0) = ±0Sin(±Inf) = NaNSin(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Sin(math.Pi))}
Output:0.00

funcSincos

func Sincos(xfloat64) (sin, cosfloat64)

Sincos returns Sin(x), Cos(x).

Special cases are:

Sincos(±0) = ±0, 1Sincos(±Inf) = NaN, NaNSincos(NaN) = NaN, NaN
Example
package mainimport ("fmt""math")func main() {sin, cos := math.Sincos(0)fmt.Printf("%.2f, %.2f", sin, cos)}
Output:0.00, 1.00

funcSinh

func Sinh(xfloat64)float64

Sinh returns the hyperbolic sine of x.

Special cases are:

Sinh(±0) = ±0Sinh(±Inf) = ±InfSinh(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Sinh(0))}
Output:0.00

funcSqrt

func Sqrt(xfloat64)float64

Sqrt returns the square root of x.

Special cases are:

Sqrt(+Inf) = +InfSqrt(±0) = ±0Sqrt(x < 0) = NaNSqrt(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {const (a = 3b = 4)c := math.Sqrt(a*a + b*b)fmt.Printf("%.1f", c)}
Output:5.0

funcTan

func Tan(xfloat64)float64

Tan returns the tangent of the radian argument x.

Special cases are:

Tan(±0) = ±0Tan(±Inf) = NaNTan(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Tan(0))}
Output:0.00

funcTanh

func Tanh(xfloat64)float64

Tanh returns the hyperbolic tangent of x.

Special cases are:

Tanh(±0) = ±0Tanh(±Inf) = ±1Tanh(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f", math.Tanh(0))}
Output:0.00

funcTrunc

func Trunc(xfloat64)float64

Trunc returns the integer value of x.

Special cases are:

Trunc(±0) = ±0Trunc(±Inf) = ±InfTrunc(NaN) = NaN
Example
package mainimport ("fmt""math")func main() {fmt.Printf("%.2f\n", math.Trunc(math.Pi))fmt.Printf("%.2f\n", math.Trunc(-1.2345))}
Output:3.00-1.00

funcY0

func Y0(xfloat64)float64

Y0 returns the order-zero Bessel function of the second kind.

Special cases are:

Y0(+Inf) = 0Y0(0) = -InfY0(x < 0) = NaNY0(NaN) = NaN

funcY1

func Y1(xfloat64)float64

Y1 returns the order-one Bessel function of the second kind.

Special cases are:

Y1(+Inf) = 0Y1(0) = -InfY1(x < 0) = NaNY1(NaN) = NaN

funcYn

func Yn(nint, xfloat64)float64

Yn returns the order-n Bessel function of the second kind.

Special cases are:

Yn(n, +Inf) = 0Yn(n ≥ 0, 0) = -InfYn(n < 0, 0) = +Inf if n is odd, -Inf if n is evenYn(n, x < 0) = NaNYn(n, NaN) = NaN

Types

This section is empty.

Source Files

View all Source files

Directories

PathSynopsis
Package big implements arbitrary-precision arithmetic (big numbers).
Package big implements arbitrary-precision arithmetic (big numbers).
internal/asmgen
Asmgen generates math/big assembly.
Asmgen generates math/big assembly.
Package bits implements bit counting and manipulation functions for the predeclared unsigned integer types.
Package bits implements bit counting and manipulation functions for the predeclared unsigned integer types.
Package cmplx provides basic constants and mathematical functions for complex numbers.
Package cmplx provides basic constants and mathematical functions for complex numbers.
Package rand implements pseudo-random number generators suitable for tasks such as simulation, but it should not be used for security-sensitive work.
Package rand implements pseudo-random number generators suitable for tasks such as simulation, but it should not be used for security-sensitive work.
v2
Package rand implements pseudo-random number generators suitable for tasks such as simulation, but it should not be used for security-sensitive work.
Package rand implements pseudo-random number generators suitable for tasks such as simulation, but it should not be used for security-sensitive work.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp