Every line of 'math pow golang' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Go code is secure.
3 func myPow(x float64, n int) float64 { 4 if n < 0 { 5 return 1.0 / pow(x, -n) 6 } 7 8 return pow(x, n) 9 }
249 func Pow(x Node, power mat.Float) Node { 250 return globalGraph.Pow(x, power) 251 }
147 func pow(A mat.Matrix, F *mat.Dense, exp float64) { 148 ar, ac := A.Dims() 149 fr, fc := F.Dims() 150 if ar != fr || ac != fc { 151 panic(mat.ErrShape) 152 } 153 for i := 0; i < ar; i++ { 154 for j := 0; j < ac; j++ { 155 F.Set(i, j, math.Pow(A.At(i, j), exp)) 156 } 157 158 } 159 }
7 func Pow(a, b float64) float64 { 8 return math.Pow(a, b) 9 }
128 func pow2(x uint32) uint32 { 129 x-- 130 x |= x >> 1 131 x |= x >> 2 132 x |= x >> 4 133 x |= x >> 8 134 x |= x >> 16 135 return x + 1 136 }
9 func Pow(x, y float64) float64 { 10 return math.Pow(x, y) 11 }
406 func (gf *BuiltInFunctions) Pow(x, y float64) float64 { 407 return math.Pow(x, y) 408 }
161 func Pow(x, y Floater) float64 { 162 return math.Pow(x.Float(), y.Float()) 163 }
72 func PowF64(a float64, b float64) float64 { return math.Pow(a, b) }
94 func (e Engine) pow(ctx ExecutionContext, left, right types.Value) (types.Value, error) { 95 defer e.profiler.Enter("pow").Exit() 96 97 if left == nil || right == nil { 98 return nil, fmt.Errorf("cannot exponentiate %T and %T", left, right) 99 } 100 101 if exponentiator, ok := left.Type().(types.ArithmeticExponentiator); ok { 102 result, err := exponentiator.Pow(left, right) 103 if err != nil { 104 return nil, fmt.Errorf("pow: %w", err) 105 } 106 return result, nil 107 } 108 return nil, fmt.Errorf("%v does not support exponentiation", left.Type()) 109 }