as was mentioned in your previous question, -1 and 10 are both "correct" answers to the MOD question. Which one you really want depends on exactly the question being asked.

So, what exactly is it you want to do?

If you want the -1 result, is that because 10 is smaller than 11?

If so, then for a < b

you can get your negative results like this .... b*(a/b) - b

for a>= b you will get your results like this... b*(a/b)

So, what exactly is it you want to do?

If you want the -1 result, is that because 10 is smaller than 11?

If so, then for a < b

you can get your negative results like this .... b*(a/b) - b

for a>= b you will get your results like this... b*(a/b)