• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 15293
  • Last Modified:

calculating MOD on a calculator

I am trying to figure out how to calculate MOD on a calculater and the following website seems to work well for large numbers;
http://forums.xkcd.com/viewtopic.php?f=17&t=15092
but what if I want to calculate 10MOD11 which I know is -1
I do as follows;
10/11=0.909
0.909-0=0.909
0.909*11=10 ??

Can someone clarify how to calculate this on a calculator?

thanks
0
jtiernan2008
Asked:
jtiernan2008
  • 2
1 Solution
 
sdstuberCommented:
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)
0
 
sdstuberCommented:
in the above (a/b) should be the fractional remainder of that division, not the division itself.

0
 
NovaDenizenCommented:
In modulo 11 arithmetic, -1 is equivalent to 10.  

5 + (-1) = 4
5 + 10 = 15, but we're modulo 11 so 15 = 4 + 11 = 4.

Whenever a + b*m = c + d*m, a and c are equal modulo m.
0
 
jtiernan2008Author Commented:
those formuales are actually better than what is on the website
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now