title: Modulus (Float) vs Branch
body: <p>Given 2 expressions that do the same thing (<code>[-3.14, 3.14] -&gt; [0, 6.28]</code>):</p>
  
  <pre><code>a &gt; 0? a : a + 6.28
  </code></pre>
  
  <p>or</p>
  
  <pre><code>fmod(a + 6.28, 6.28)
  </code></pre>
  
  <p>Is there a general difference between the two in performance?</p>
  
  <p><strong>Edit:</strong>
  Suppose such an expression is called many times (such that performance is relevant) and that the input <code>a</code> is different each time. (To make the question more directly answerable).</p>