title: Convert positive number to a negative number - iOS
body: <p>I have a simple app with an integer. I want to check the value in the integer and change it from a positive to a negative if it is a positive value. I also want it to check to see if the integer is a negative and then change it to a positive if it is currently a negative. The code below is what I thought of:</p>
  
  <pre><code>int number;
  
  // number gets set.... etc...
  
  // Now do number check.
  if (number &gt; 0) {
      number = (0 - number);
  }
  
  else if (number &lt; 0) {
  
      // Since number is negative, lets try to
      // minus minus the number and make it positive.
      number = (0 - number);
  }
  </code></pre>
  
  <p>My question is, is my method correct and more importantly a good way of achieving this functionality? I read that you can use a method called <code>abs()</code> but from what I understand its not safe?</p>
  
  <p>Thanks for your time, Dan.</p>