title: Swift 3 Migration - Double Extension rounding issue
body: <p>I'm migrating our codebase to Swift 3 and I've come across a compilation issue that I can't explain or fix. </p>
  
  <p>I have a method in a <code>Double</code> extension that rounds the <code>Double</code> to a certain number of digits:</p>
  
  <pre><code>public func roundToPlaces(places: Int) -&gt; Double {
      let divisor = pow(10.0, Double(places))
      return round(self * divisor) / divisor
  }
  </code></pre>
  
  <p>For example: 
  <code>12.34567.roundToPlaces(2)</code> should return <code>12.35</code>. However, I'm getting a compilation issue for the <code>round</code> method used in this extension. It's saying that I <code>Cannot use mutating member on immutable value: 'self' is immutable</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/yiIAu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yiIAu.png" alt="compilation error image"></a></p>
  
  <p>Any ideas on what's going on here? How do I fix this issue?</p>