I think you've misunderstood how modulus works, or maybe I've misunderstood you
Basically in your x % y example, you are taking y away from x until x is less than y, then returning x.
Example in C that I wrote a while ago:
int mod(int a, int b)
{
for(; a > b; a -= b);
return a;
}
So if x = 1, y = 8
if 1 > 8 we take away 8, but it isn't so...
answer is 1
Reputation Points: 12
Solved Threads: 7
Junior Poster in Training
Offline 57 posts
since Jul 2010