Math Help Forum

Math Help Forum Feed Site Feed

Go Back   Math Help Forum > University Math Help > Discrete Mathematics, Set Theory and Logic
Reply
 
Thread Tools Display Modes
  #1  
Old April 10th, 2009, 08:20 PM
Newbie
 
Join Date: Jan 2009
Posts: 15
Country:
Thanks: 6
Thanked 0 Times in 0 Posts
mjlaz is on a distinguished road
Default a mod b (remainder) with negative integers?

I understand how do calculate something like 25 mod 20, i.e. 25 mod 20 = 5. However, negatives confuse me. Such as 123 mod -123 or -89 mod -98. Can you offer some insight in dealing with negatives in the a mod b operation?

Thank you.
Reply With Quote
Advertisement
 
  #2  
Old April 10th, 2009, 09:40 PM
Junior Member
 
Join Date: Apr 2009
Posts: 43
Country:
Thanks: 5
Thanked 5 Times in 5 Posts
K A D C Dilshan is on a distinguished road
Default My answer

Quote:
Originally Posted by mjlaz View Post
I understand how do calculate something like 25 mod 20, i.e. 25 mod 20 = 5. However, negatives confuse me. Such as 123 mod -123 or -89 mod -98. Can you offer some insight in dealing with negatives in the a mod b operation?

Thank you.
a mod b can be done with any integer positive or negative it doesn`t matter .
a mod b gives you the remainder .
a mod b = (a - P*b) (P is quotient)

for instance take 123 mod -123
a = 123;b = -123 ;P = -1 so answer is 0 .
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -7. The time now is 07:35 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
©2005 - 2009 Math Help Forum


Math Help Forum is a community of maths forums with an emphasis on maths help in all levels of mathematics.
Register to post your math questions or just hang out and try some of our math games or visit the arcade.