title: Why can't I divide integers in swift?
body: <p>In the <a href="https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/GuidedTour.html#//apple_ref/doc/uid/TP40014097-CH2-XID_1" rel="noreferrer">Swift "Tour" documentation</a>, there's an exercise where you build on the following function to average a set of numbers:</p>
  
  <pre><code>func sumOf(numbers: Int...) -&gt; Int {
      var sum = 0
      for number in numbers {
          sum += number
      }
      return sum
  }
  </code></pre>
  
  <p>I can make this work using something like the following:</p>
  
  <pre><code>func averageOf(numbers: Double...) -&gt; Double {
      var sum: Double = 0, countOfNumbers: Double = 0
      for number in numbers {
          sum += number
          countOfNumbers++
      }
      var result: Double = sum / countOfNumbers
      return result
  }
  </code></pre>
  
  <p>My question is, why do I have to cast everything as a Double to make it work? If I try to work with integers, like so:</p>
  
  <pre><code>func averageOf(numbers: Int...) -&gt; Double {
      var sum = 0, countOfNumbers = 0
      for number in numbers {
          sum += number
          countOfNumbers++
      }
      var result: Double = sum / countOfNumbers
      return result
  }
  </code></pre>
  
  <p>I get the following error: <code>Could not find an overload for '/' that accepts the supplied arguments</code></p>