title: How to use Math.Pow with integers in Golang
body: <p>I keep getting the error &quot;<strong>cannot use a (type int) as type float64 in argument to math.Pow, cannot use x (type int) as type float64 in argument to math.Pow,
  invalid operation: math.Pow(a, x) % n (mismatched types float64 and int)</strong>&quot;</p>
  <pre><code>func pPrime(n int) bool {
      var nm1 int = n - 1
      var x int = nm1/2
      a := 1;
      for  a &lt; n {
          if  (math.Pow(a, x)) % n == nm1 {
              return true
          }
      }
      return false
  }
  </code></pre>