Yes, it is an obvious error, the answer can never exceed m. In either direction.
]]>Bob
]]>Good Morning.
That is what I am getting too.
]]>Bob
]]>If you did that what do you get for -65 mod -17?
]]>The formula should always give a value x, so that -m < x < m (assuming m is positive ... reverse the signs otherwise)
Bob
]]>Use a calculator to at least check.
]]>I am getting
]]>There are a lot of minus signs to take account of. Easy to slip up on that.
Bob
]]>I am getting -3 as the answer. Can I see what you have done?
]]>In effect, that was my point in post 7.
The following are all equivalent mod 5
-12, -7, -2, 3, 8, 13, 18 ......
Basically just add 5.
If you follow my link to Wiki you will see that two definitions are possible and there are even more variations amongst computer languages.
Your brother is right using the 'Euclidean division' definition ... under this no negatives are allowed.
Which is why I think you need to check with your teacher / tutor and see what definition is required.
Bob
]]>Yes he has (in post 3). He got -2
I see that now. He got the right answer too.
Sometimes it has to be the same sign as the divisor. I gave him the one that gets the same answers as Wolfram would.
Unfortunately he skeddadled right after he solved it. I wanted to go a little deeper.
]]>