---------- Forwarded message ----------
From: [EMAIL PROTECTED] < [EMAIL PROTECTED]>
Date: Apr 23, 2006 12:57 PM
Subject: Posting error: Algorithm Geeks
To: [EMAIL PROTECTED]

You do not have permission to post to group algogeeks. You may need to join
the group before being allowed to post, or this group may not be open to
posting.

Visit http://groups.google.com/group/algogeeks/about to join or learn more about who
is allowed to post to the group.

Help on using Google Groups is also available at:
http://groups.google.com/support


---------- Forwarded message ----------
From: "SIVA SANKARA REDDY" <[EMAIL PROTECTED]>
To:  algogeeks@googlegroups.com
Date: Sun, 23 Apr 2006 12:57:16 +0530
Subject: Re: [algogeeks] Help on modular arithmetic
Hi Faran,
         Let's say b/a=q, b%a=r; The cond. to be satisfied is b=a*q+r; When dealing with -ve numbers there may be more than one way to satisfy this cond. So, the c language follows the foll. rule :-   sign(q)= sign(a)*sign(b); and sign(r)=sign(b);

         So, you need 2 find such q and r with above signs & satisfying above condition. And such a  'r' wud be  ur required answer.

==>
    -22%3 = -1; (sign of numerator)
   -22%-3 = -1; (sign of numerator)

Cheers,
siva.

On 4/23/06, Farhan < [EMAIL PROTECTED] > wrote:

Can you guys tell me what will the answers of following operations:

1. -22 % 3 = ?
2. 22 % -3 = ? (This one I know actually, it will be 2, I know the
calculation but do not know the explanation)
3. -22 % -3 = ?

Thanks in advance.




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to