Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 22 Jun 2011 10:02:41 -0500 From: Pete Becker Organization: Roundhouse Consulting, Ltd. Newsgroups: comp.lang.c++ Date: Wed, 22 Jun 2011 11:02:41 -0400 Message-ID: <201106221102413141-pete@versatilecodingcom> References: <589f8b74-d065-44a5-ab9e-81e6a6fcd88b@v12g2000vby.googlegroups.com> <2011062210102947914-pete@versatilecodingcom> <1eca825a-8d6f-4939-92e3-2f1fcdc553cb@fr19g2000vbb.googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: (simple?) problem with multiplication User-Agent: Unison/2.1.4 Lines: 35 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-N8r40Eazbh4bB0rw5b3Wz5XDOOn5f5qlNui3sKYEh0Rx2Y+cRwqgghK2ytQeMmJoe8zIinNCtJCk/Mk!+yYKuSNY3bWq1BA+P6CGUMZppcie7cR7iDbInqKNWJU2XeAbHQL1hKwAKtHdubCe5W40XVQ= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2337 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:7062 On 2011-06-22 10:39:37 -0400, Leigh Johnston said: > On 22/06/2011 15:33, Dilip wrote: >> On Jun 22, 10:19 am, Leigh Johnston wrote: >>> On 22/06/2011 15:10, Pete Becker wrote: >>> >>>> On 2011-06-22 09:55:49 -0400, gwowen said: >>> >>>>> You know that modulo is distributive over multiplication ... >>> >>>> But it's not. :-( >>> >>>> (5 * 2) % 10 != (5%10) * (2%10) >>> >>> Yes it is: >>> >>> (5 * 2) % 10 == ( (5 % 10) * (2 % 10) ) % 10 >>> >>> /Leigh >> >> Huh? For an operation to be called distributive it has to be both left >> & right distributive. Obviously modulo over multiplication is not >> right distributive as Pete Showed. > > I guess, however what I showed is probably what gwowen actually meant. > That's probably true, but it's not what distributive means. -- Pete Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The Standard C++ Library Extensions: a Tutorial and Reference (www.petebecker.com/tr1book)