Debian Codegraph @

quickfix/qf1005/testdata/go1.0/CheckMathPow/CheckMathPow.go.golden

raw
1 package pkg
2
3 import "math"
4
5 func fn() {
6 var x float64
7
8 _ = 1.0 //@ diag(`could expand call to math.Pow`)
9 _ = x //@ diag(`could expand call to math.Pow`)
10 _ = x * x //@ diag(`could expand call to math.Pow`)
11 _ = x * x * x //@ diag(`could expand call to math.Pow`)
12 _ = math.Pow(x, 6)
13
14 const a = 2
15 const b = 2.0
16 const c float64 = 2
17
18 _ = float64(a * a) //@ diag(`could expand call to math.Pow`)
19 _ = b * b //@ diag(`could expand call to math.Pow`)
20 _ = c * c //@ diag(`could expand call to math.Pow`)
21 _ = a * 1.0 * a * 1.0 //@ diag(`could expand call to math.Pow`)
22
23 _ = x * 2 * x * 2 //@ diag(`could expand call to math.Pow`)
24 _ = (x + 2) * (x + 2) //@ diag(`could expand call to math.Pow`)
25
26 _ = math.Pow(x, x)
27 _ = math.Pow(x, -1)
28 }