> 
> **Possible Duplicate:**  
> 
> [Integer division in JavaScript](https://stackoverflow.com/questions/4228356/integer-division-in-javascript) 
> 
> 
> 

Hopefully this is a simple question, basically I need to do this:

divider = 15

number = 50

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?

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.

Any help?

Cheers, 
Shannon

EDIT:

Thanks to Adil:

```
x = 50;
y = 15;
res = x % y;
x = (x - res) / y;
// x = 3

```