I divide a value and if the remainder is not 0 I want the closest possible divisor without remainder.
Example:
I have:
$100 \% 48 = 4$
Now I am looking for the next value which divide 100 wihtout remainder. Result: $50$
$100 \% 50 = 0%$
Just another example:
$14 \% 6 = 2$
Result $7$
$14 \% 7 = 0$
Does anyone know how to calculate this?
etc.