X7ROOT File Manager
Current Path:
/opt/golang/1.17.2/src/math
opt
/
golang
/
1.17.2
/
src
/
math
/
π
..
π
abs.go
(363 B)
π
acos_s390x.s
(3.73 KB)
π
acosh.go
(1.71 KB)
π
acosh_s390x.s
(4.32 KB)
π
all_test.go
(85.27 KB)
π
arith_s390x.go
(3.73 KB)
π
arith_s390x_test.go
(10.78 KB)
π
asin.go
(1.08 KB)
π
asin_s390x.s
(4.16 KB)
π
asinh.go
(1.92 KB)
π
asinh_s390x.s
(5.74 KB)
π
atan.go
(3.03 KB)
π
atan2.go
(1.52 KB)
π
atan2_s390x.s
(6.93 KB)
π
atan_s390x.s
(3.69 KB)
π
atanh.go
(1.99 KB)
π
atanh_s390x.s
(5.36 KB)
π
big
π
bits
π
bits.go
(1.87 KB)
π
cbrt.go
(2.31 KB)
π
cbrt_s390x.s
(4.89 KB)
π
cmplx
π
const.go
(2.33 KB)
π
const_test.go
(1.29 KB)
π
copysign.go
(378 B)
π
cosh_s390x.s
(5.59 KB)
π
dim.go
(1.68 KB)
π
dim_amd64.s
(1.92 KB)
π
dim_arm64.s
(963 B)
π
dim_asm.go
(380 B)
π
dim_noasm.go
(450 B)
π
dim_riscv64.s
(1.16 KB)
π
dim_s390x.s
(1.97 KB)
π
erf.go
(11.5 KB)
π
erf_s390x.s
(8.5 KB)
π
erfc_s390x.s
(14.4 KB)
π
erfinv.go
(3.36 KB)
π
example_test.go
(3.66 KB)
π
exp.go
(5.37 KB)
π
exp2_asm.go
(268 B)
π
exp2_noasm.go
(301 B)
π
exp_amd64.go
(277 B)
π
exp_amd64.s
(4.24 KB)
π
exp_arm64.s
(5.36 KB)
π
exp_asm.go
(296 B)
π
exp_noasm.go
(333 B)
π
exp_s390x.s
(4.65 KB)
π
expm1.go
(7.9 KB)
π
expm1_s390x.s
(5.29 KB)
π
export_s390x_test.go
(732 B)
π
export_test.go
(357 B)
π
floor.go
(3.28 KB)
π
floor_386.s
(1.47 KB)
π
floor_amd64.s
(2 KB)
π
floor_arm64.s
(573 B)
π
floor_asm.go
(482 B)
π
floor_noasm.go
(589 B)
π
floor_ppc64x.s
(523 B)
π
floor_s390x.s
(579 B)
π
floor_wasm.s
(459 B)
π
fma.go
(4.46 KB)
π
frexp.go
(926 B)
π
gamma.go
(5.52 KB)
π
huge_test.go
(2.56 KB)
π
hypot.go
(845 B)
π
hypot_386.s
(1.81 KB)
π
hypot_amd64.s
(1.05 KB)
π
hypot_asm.go
(284 B)
π
hypot_noasm.go
(319 B)
π
j0.go
(13.6 KB)
π
j1.go
(13.3 KB)
π
jn.go
(7.17 KB)
π
ldexp.go
(1.05 KB)
π
lgamma.go
(11.02 KB)
π
log.go
(3.86 KB)
π
log10.go
(869 B)
π
log10_s390x.s
(4.73 KB)
π
log1p.go
(6.34 KB)
π
log1p_s390x.s
(5.15 KB)
π
log_amd64.s
(3.67 KB)
π
log_asm.go
(281 B)
π
log_s390x.s
(4.31 KB)
π
log_stub.go
(316 B)
π
logb.go
(1014 B)
π
mod.go
(900 B)
π
modf.go
(910 B)
π
modf_arm64.s
(447 B)
π
modf_asm.go
(322 B)
π
modf_noasm.go
(359 B)
π
modf_ppc64x.s
(440 B)
π
nextafter.go
(1.2 KB)
π
pow.go
(3.22 KB)
π
pow10.go
(1.24 KB)
π
pow_s390x.s
(16.27 KB)
π
rand
π
remainder.go
(2.04 KB)
π
signbit.go
(302 B)
π
sin.go
(6.35 KB)
π
sin_s390x.s
(8.34 KB)
π
sincos.go
(1.75 KB)
π
sinh.go
(1.69 KB)
π
sinh_s390x.s
(5.98 KB)
π
sqrt.go
(4.9 KB)
π
sqrt_386.s
(304 B)
π
sqrt_amd64.s
(334 B)
π
sqrt_arm.s
(529 B)
π
sqrt_arm64.s
(310 B)
π
sqrt_asm.go
(416 B)
π
sqrt_mipsx.s
(409 B)
π
sqrt_noasm.go
(469 B)
π
sqrt_ppc64x.s
(362 B)
π
sqrt_riscv64.s
(308 B)
π
sqrt_s390x.s
(309 B)
π
sqrt_wasm.s
(273 B)
π
stubs.go
(2.59 KB)
π
stubs_s390x.s
(12.38 KB)
π
tan.go
(3.67 KB)
π
tan_s390x.s
(2.73 KB)
π
tanh.go
(2.65 KB)
π
tanh_s390x.s
(4.57 KB)
π
trig_reduce.go
(3.33 KB)
π
unsafe.go
(1.27 KB)
Editing: pow.go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package math func isOddInt(x float64) bool { xi, xf := Modf(x) return xf == 0 && int64(xi)&1 == 1 } // Special cases taken from FreeBSD's /usr/src/lib/msun/src/e_pow.c // updated by IEEE Std. 754-2008 "Section 9.2.1 Special values". // Pow returns x**y, the base-x exponential of y. // // Special cases are (in order): // Pow(x, Β±0) = 1 for any x // Pow(1, y) = 1 for any y // Pow(x, 1) = x for any x // Pow(NaN, y) = NaN // Pow(x, NaN) = NaN // Pow(Β±0, y) = Β±Inf for y an odd integer < 0 // Pow(Β±0, -Inf) = +Inf // Pow(Β±0, +Inf) = +0 // Pow(Β±0, y) = +Inf for finite y < 0 and not an odd integer // Pow(Β±0, y) = Β±0 for y an odd integer > 0 // Pow(Β±0, y) = +0 for finite y > 0 and not an odd integer // Pow(-1, Β±Inf) = 1 // Pow(x, +Inf) = +Inf for |x| > 1 // Pow(x, -Inf) = +0 for |x| > 1 // Pow(x, +Inf) = +0 for |x| < 1 // Pow(x, -Inf) = +Inf for |x| < 1 // Pow(+Inf, y) = +Inf for y > 0 // Pow(+Inf, y) = +0 for y < 0 // Pow(-Inf, y) = Pow(-0, -y) // Pow(x, y) = NaN for finite x < 0 and finite non-integer y func Pow(x, y float64) float64 { if haveArchPow { return archPow(x, y) } return pow(x, y) } func pow(x, y float64) float64 { switch { case y == 0 || x == 1: return 1 case y == 1: return x case IsNaN(x) || IsNaN(y): return NaN() case x == 0: switch { case y < 0: if isOddInt(y) { return Copysign(Inf(1), x) } return Inf(1) case y > 0: if isOddInt(y) { return x } return 0 } case IsInf(y, 0): switch { case x == -1: return 1 case (Abs(x) < 1) == IsInf(y, 1): return 0 default: return Inf(1) } case IsInf(x, 0): if IsInf(x, -1) { return Pow(1/x, -y) // Pow(-0, -y) } switch { case y < 0: return 0 case y > 0: return Inf(1) } case y == 0.5: return Sqrt(x) case y == -0.5: return 1 / Sqrt(x) } yi, yf := Modf(Abs(y)) if yf != 0 && x < 0 { return NaN() } if yi >= 1<<63 { // yi is a large even int that will lead to overflow (or underflow to 0) // for all x except -1 (x == 1 was handled earlier) switch { case x == -1: return 1 case (Abs(x) < 1) == (y > 0): return 0 default: return Inf(1) } } // ans = a1 * 2**ae (= 1 for now). a1 := 1.0 ae := 0 // ans *= x**yf if yf != 0 { if yf > 0.5 { yf-- yi++ } a1 = Exp(yf * Log(x)) } // ans *= x**yi // by multiplying in successive squarings // of x according to bits of yi. // accumulate powers of two into exp. x1, xe := Frexp(x) for i := int64(yi); i != 0; i >>= 1 { if xe < -1<<12 || 1<<12 < xe { // catch xe before it overflows the left shift below // Since i !=0 it has at least one bit still set, so ae will accumulate xe // on at least one more iteration, ae += xe is a lower bound on ae // the lower bound on ae exceeds the size of a float64 exp // so the final call to Ldexp will produce under/overflow (0/Inf) ae += xe break } if i&1 == 1 { a1 *= x1 ae += xe } x1 *= x1 xe <<= 1 if x1 < .5 { x1 += x1 xe-- } } // ans = a1*2**ae // if y < 0 { ans = 1 / ans } // but in the opposite order if y < 0 { a1 = 1 / a1 ae = -ae } return Ldexp(a1, ae) }
Upload File
Create Folder