title: Subtracting when value is negative, adding when value is positive
body: <p>I have a variable (1) that is either &lt; 0 or 0 >. That value should be added to another value (2) when value (1) is > 0. However value (2) should be subtract by value (1) if that value is &lt; 0, of course making value (1) positive when subtracting. My code looks like this:</p>
  
  <pre><code>positionRandomButton = CGPoint(x: CGFloat(randomXValue) + card.position.x, y: CGFloat(randomYValue) + card.position.y)
  </code></pre>
  
  <p>Here randomXValue and randomYValue can be that value (1). Now it always adds be, despised value (1) can be &lt; 0. I can solve this by making four if cases, but I think there should be a better method. the +'s you see in the code should change accordingly, or something else should happen. Thanks.</p>