title: Which is the fastest way to get the absolute value of a number
body: <p>Which is the fastest way to implement an operation that returns the absolute value of a number?</p>
  
  <pre><code>x=root(x²)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>if !isPositive(x):
      x=x*(-1)
  </code></pre>
  
  <p>Actually this question can be translated as, how fast is an <code>if</code> (and why please).</p>
  
  <p>My college programing professors always told me to avoid <code>if</code>s for they are extremely slow, but I always forgot to ask how slow and why. Does anybody here know?</p>