Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: -1%N = -1
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 13 of 14 Topic 9512 of 10094
Post > Topic >>

Re: -1%N = -1

by "Maarten Kronenburg" <M.Kronenburg@[EMAIL PROTECTED] > Apr 20, 2008 at 03:49 PM

"Maarten Kronenburg"  wrote in message
>
In addition to my previous message:
It's rather easy to compute the mod from the rem,
it's just correcting the sign:
int mod( int a, int b )
{ a %= b;
  if( ( a < 0 && b > 0 ) ||
      ( a > 0 && b < 0 ) )
   a += b;
 return a;
}



-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 14 Posts in Topic:
-1%N = -1
OuFeRRaT <ouferrat@[EM  2008-04-17 03:52:00 
Re: -1%N = -1
Thomas Richter <thor@[  2008-04-17 11:36:17 
Re: -1%N = -1
Marco Manfredini <ok_n  2008-04-17 11:41:52 
Re: -1%N = -1
Francis Glassborow <fr  2008-04-17 11:43:14 
Re: -1%N = -1
guinness.tony@[EMAIL PROT  2008-04-17 11:41:28 
Re: -1%N = -1
"Maarten Kronenburg&  2008-04-17 12:03:20 
Re: -1%N = -1
Seungbeom Kim <musiphi  2008-04-17 16:15:48 
Re: -1%N = -1
"Maarten Kronenburg&  2008-04-17 19:33:50 
Re: -1%N = -1
OuFeRRaT <ouferrat@[EM  2008-04-18 17:14:06 
Re: -1%N = -1
John G Harris <news0@[  2008-04-19 02:01:59 
Re: -1%N = -1
Thomas Richter <thor@[  2008-04-19 18:12:30 
Re: -1%N = -1
peter koch larsen <pet  2008-04-20 15:46:04 
Re: -1%N = -1
"Maarten Kronenburg&  2008-04-20 15:49:33 
Re: -1%N = -1
John G Harris <news0@[  2008-04-20 15:49:40 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 18:32:27 CDT 2008.