title: The tilde operator in Scala
body: <p>What does the ~ do in this bit of Scala?</p>
  
  <p>For example:</p>
  
  <pre><code>scala&gt; val apple = 1
  apple: Int = 1
  
  scala&gt; ~apple
  res0: Int = -2
  </code></pre>
  
  <p>What did that worm do to my apple?</p>