title: Confused with Type conversions in golang
body: <p>I recently tried to learn golang. But I got confused with this code from <a href="https://tour.golang.org/basics/13" rel="nofollow noreferrer">https://tour.golang.org/basics/13</a>.</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "math"
  )
  
  func main() {
      var x, y int = 3, 4
      var f float64 = math.Sqrt(float64(x*x + y*y))
      var z uint = uint(f)
      fmt.Println(x, y, z)
  }
  </code></pre>
  
  <p>That one works well. Then I tried  </p>
  
  <p>var f = math.Sqrt(9 + 16) </p>
  
  <p>which also works. But when I change it to <code>var f = math.Sqrt(x*x + y*y)</code> why is it not working? It says <code>cannot use x * x + y * y (type int) as type float64 in argument to math.Sqrt</code></p>
  
  <p>I have javascript background, and I somehow can't understand the code above.</p>