Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Subject | Re: implementation of unsigned addition on one's complement machines |
| Newsgroups | comp.arch |
| References | <1ca86407-1dbc-452c-af08-1f6d1bb76e24@u9g2000vbx.googlegroups.com> <49f2f40a-cf50-4f49-89ee-4d4e9ad56472@cc2g2000vbb.googlegroups.com> <j9tesl$l0g$1@gosset.csi.cam.ac.uk> <8503c9bb-07c6-4bae-ad8c-64f52322006c@g21g2000yqc.googlegroups.com> <j9thg3$lqc$1@gosset.csi.cam.ac.uk> |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Date | 2011-11-15 17:33 +0000 |
| Message-ID | <2011Nov15.183339@mips.complang.tuwien.ac.at> (permalink) |
nmm1@cam.ac.uk writes: >In article <8503c9bb-07c6-4bae-ad8c-64f52322006c@g21g2000yqc.googlegroups.com>, >Luca Forlizzi <luca.forlizzi@gmail.com> wrote: >>> >>> >As you probably know, in C unsigned arithmetic is modular. This is >>> >easily implemented in two's complement by ignoring the carry out of >>> >addition. >>> >>> Division and remainder aren't. >> >>excuse me, do you mean that they are not modular or that the can not >>be implemented by ignoring the carry out? > >There is no carry-out involved except, debatably, when dividing >-(1+maxint) by -1 on a two's complete system. That's not a division of unsigned numbers. I don't think you can produce an overflow with division (or remainder) of unsigned numbers in C, so your mentioning of division does not contribute anything but noise to the discussion. Btw, wouldn't a C standards bigot write (-maxint)-1 instead of -(1+maxint)? - anton -- M. Anton Ertl Some things have to be seen to be believed anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen http://www.complang.tuwien.ac.at/anton/home.html
Back to comp.arch | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
implementation of unsigned addition on one's complement machines Luca Forlizzi <luca.forlizzi@gmail.com> - 2011-11-14 07:08 -0800
Re: implementation of unsigned addition on one's complement machines torbenm@diku.dk (Torben Ægidius Mogensen) - 2011-11-14 17:55 +0100
Re: implementation of unsigned addition on one's complement machines torbenm@diku.dk (Torben Ægidius Mogensen) - 2011-11-15 10:29 +0100
Re: implementation of unsigned addition on one's complement machines Luca Forlizzi <luca.forlizzi@gmail.com> - 2011-11-15 02:12 -0800
Re: implementation of unsigned addition on one's complement machines nmm1@cam.ac.uk - 2011-11-15 10:28 +0000
Re: implementation of unsigned addition on one's complement machines Luca Forlizzi <luca.forlizzi@gmail.com> - 2011-11-15 03:07 -0800
Re: implementation of unsigned addition on one's complement machines nmm1@cam.ac.uk - 2011-11-15 11:13 +0000
Re: implementation of unsigned addition on one's complement machines anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-15 17:33 +0000
Re: implementation of unsigned addition on one's complement machines nmm1@cam.ac.uk - 2011-11-15 18:14 +0000
Re: implementation of unsigned addition on one's complement machines anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-16 09:34 +0000
Re: implementation of unsigned addition on one's complement machines Michael S <already5chosen@yahoo.com> - 2011-11-16 09:04 -0800
Re: implementation of unsigned addition on one's complement machines nmm1@cam.ac.uk - 2011-11-16 17:31 +0000
Re: implementation of unsigned addition on one's complement machines Robert Wessel <robertwessel2@yahoo.com> - 2011-11-16 11:54 -0600
Re: implementation of unsigned addition on one's complement machines Luca Forlizzi <luca.forlizzi@gmail.com> - 2011-11-15 03:11 -0800
Re: implementation of unsigned addition on one's complement machines anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-11-15 17:26 +0000
Re: implementation of unsigned addition on one's complement machines Terje Mathisen <"terje.mathisen at tmsw.no"> - 2011-11-15 23:12 +0100
Re: implementation of unsigned addition on one's complement machines Kai Harrekilde-Petersen <khp@harrekilde.dk> - 2011-11-15 23:25 +0100
csiph-web