Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.news-service.com!216.196.110.146.MISMATCH!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Sat, 25 Jun 2011 02:58:02 -0500 From: Gareth Owen Newsgroups: comp.lang.c++ Subject: Re: (simple?) problem with multiplication References: <589f8b74-d065-44a5-ab9e-81e6a6fcd88b@v12g2000vby.googlegroups.com> <2a469bdc-e9e8-4629-b31b-00b569052409@gh5g2000vbb.googlegroups.com> <2011062413322032750-pete@versatilecodingcom> Date: Sat, 25 Jun 2011 08:58:28 +0100 Message-ID: <87hb7ewdej.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:wfj6fX0mKUDWp9Y+RV49E7RTXLg= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Lines: 8 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-PIdQTQwhr3ubD1T8+6nZ7TFJGdZLI4iQbfHE6JyC6ogGxEOoOWe0deH1mKcw8hvuCTkBhSOXbcntFyF!4slWY1scdJtL5JhswzJOL4UovUhrNPZ6v8+ohezaPGhJMMtVOJ+3mQjUt6TogtCrJeI= 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: 1479 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:7145 Kai-Uwe Bux writes: > That said, a version of double-and-add for modulo arithmetic has been > proposed elsethread; and that version at least did assume that 2*(a%B) does > not overflow. My double-and-add version did have an overflow check. It's a simple problem - its only the details are a pain.