title: Why does using the '~' operator in scala give me a negative value
body: <p>I am new to scala and was trying to access the scala not operator. I got to know that I could use the '-' operator for  logical NOT operation. But sometimes this operator gives me a negative answer such as (-1)</p>
  
  <p>For example :</p>
  
  <pre><code> val x = 1
   val y =(~x)
  </code></pre>
  
  <p>Here the value y gives me a -1 instead of a 0. But I need the answer in the form of a 1 or a 0. Can somebody tell me what am I missing here ?
  Thank you for your help in advance.</p>