gitee.com/quant1x/num@v0.3.2/math32/const.go (about) 1 package math32 2 3 // Mathematical constants. 4 const ( 5 E = float32(2.71828182845904523536028747135266249775724709369995957496696763) // http://oeis.org/A001113 6 Pi = float32(3.14159265358979323846264338327950288419716939937510582097494459) // http://oeis.org/A000796 7 Phi = float32(1.61803398874989484820458683436563811772030917980576286213544862) // http://oeis.org/A001622 8 9 Sqrt2 = float32(1.41421356237309504880168872420969807856967187537694807317667974) // http://oeis.org/A002193 10 SqrtE = float32(1.64872127070012814684865078781416357165377610071014801157507931) // http://oeis.org/A019774 11 SqrtPi = float32(1.77245385090551602729816748334114518279754945612238712821380779) // http://oeis.org/A002161 12 SqrtPhi = float32(1.27201964951406896425242246173749149171560804184009624861664038) // http://oeis.org/A139339 13 14 Ln2 = float32(0.693147180559945309417232121458176568075500134360255254120680009) // http://oeis.org/A002162 15 Log2E = float32(1 / Ln2) 16 Ln10 = float32(2.30258509299404568401799145468436420760110148862877297603332790) // http://oeis.org/A002392 17 Log10E = float32(1 / Ln10) 18 ) 19 20 // Floating-point limit values. 21 // Max is the largest finite value representable by the type. 22 // SmallestNonzero is the smallest positive, non-zero value representable by the type. 23 const ( 24 MaxFloat32 = 3.40282346638528859811704183484516925440e+38 // 2**127 * (2**24 - 1) / 2**23 25 SmallestNonzeroFloat32 = 1.401298464324817070923729583289916131280e-45 // 1 / 2**(127 - 1 + 23) 26 ) 27 28 // Integer limit values. 29 const ( 30 MaxInt8 = 1<<7 - 1 31 MinInt8 = -1 << 7 32 MaxInt16 = 1<<15 - 1 33 MinInt16 = -1 << 15 34 MaxInt32 = 1<<31 - 1 35 MinInt32 = -1 << 31 36 MaxInt64 = 1<<63 - 1 37 MinInt64 = -1 << 63 38 MaxUint8 = 1<<8 - 1 39 MaxUint16 = 1<<16 - 1 40 MaxUint32 = 1<<32 - 1 41 MaxUint64 = 1<<64 - 1 42 )