Results 1 to 2 of 2

Math Help - a mod b (remainder) with negative integers?

  1. #1
    Newbie
    Joined
    Jan 2009
    Posts
    21

    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.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Junior Member
    Joined
    Apr 2009
    Posts
    44

    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 .
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 2
    Last Post: March 26th 2009, 05:30 PM
  2. Replies: 5
    Last Post: March 26th 2009, 03:36 PM
  3. Negative Integers and exponents.
    Posted in the Algebra Forum
    Replies: 7
    Last Post: December 7th 2007, 01:39 PM
  4. [SOLVED] [SOLVED] Adding/Sub. negative & positive integers
    Posted in the Algebra Forum
    Replies: 7
    Last Post: August 18th 2007, 04:59 PM
  5. Positive and Negative Integers
    Posted in the Algebra Forum
    Replies: 1
    Last Post: July 2nd 2007, 06:32 PM

Search Tags


/mathhelpforum @mathhelpforum