 <p>Modulus is <em>not</em> using the <code>3</code>, it simply knows that:</p> <pre><code> 20 / 6 = 3, with a remainder of 2 =&gt; 20 % 6 = 2 </code></pre> <p>If you want the <code>3</code>, you just need the expression:</p> <pre><code>Math.floor(20 / 6) </code></pre> <p>(or possibly <code>Math.trunc</code> depending on how you want negative numbers handled - <code>floor</code> rounds towards negative infinity, <code>trunc</code> rounds toward zero).</p>