title: Square a number but preserve the sign (in c)
body: <p>Is there a simple way to preserve the sign after squaring a value. 
  I currently have:</p>
  
  <pre><code>float signed_square(float x) {
      if (x &gt; 0) {
          return x * x;
      } else {
          return -(x * x);
      }
  }
  </code></pre>