title: Math - Divide & leave remainder
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4228356/integer-division-in-javascript">Integer division in JavaScript</a>  </p>
  </blockquote>
  
  
  
  <p>Hopefully this is a simple question, basically I need to do this:</p>
  
  <p>divider = 15</p>
  
  <p>number = 50</p>
  
  <p>Obviously 15 can be divided into 50 3 times with a remainder of 5, is there a simple way I can achieve this with math?</p>
  
  <p>Obviously just dividing 50 by 15 will give me a rounded figure which I just want the lowest possible result and if there is anything left over and it's less than 15 just leave it alone.</p>
  
  <p>Any help?</p>
  
  <p>Cheers, 
  Shannon</p>
  
  <p>EDIT:</p>
  
  <p>Thanks to Adil:</p>
  
  <pre><code>x = 50;
  y = 15;
  res = x % y;
  x = (x - res) / y;
  // x = 3
  </code></pre>