From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp Subject: Re: twin complement ...... Organization: Pin Eight Software http://pineight.8m.com/ Message-ID: References: <8ngqu9$fl8$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <8nj666$bs8$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <8njife$j82$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 29 X-Trace: /KDWjZqUbiij/k+ZaK+MwOetSzXNDpFSss8H1wHg8Ha+iJGux4Mbd2lv32WxfdDZPrYkupSQkGg6!Rp+DaOKTkHMv6CrKIAyVl9KJeIG6prFDtUdejN9M+ey2Dp3RhljX/s1DOS6s2RT540BZ4JEga/Kf!Bw== X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Fri, 18 Aug 2000 15:09:47 GMT Distribution: world Date: Fri, 18 Aug 2000 15:09:47 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Fri, 18 Aug 2000 16:51:12 +0200, "Florent" wrote: >>You cause quite some confusion, here, by using the wrong term. The >>thing you're talking about is usually called 'two's-complement'. It's >>the way negative numbers are represented in integers, on almost all >>existing types of computers. > >Yes that's right and this is the name that I have learn in France, but I >quite newbye in computering and the documents I got from the controller I >have to control, use the term 'twin complement'. Is it something else or >really the 'two's-complement' ? The operation that takes 0x123 and returns 0xfffffedd is, indeed, the two's complement, and is represented in C on binary computers by the prefix operator - (a hyphen or minus sign). 0xfffffedd == -0x123 Whether the two's complement is actually what your device returns is a good candidate for some printf() debugging. -- Damian Yerrick "I refuse to listen to those who refuse to listen to reason." See the whole sig: http://www.rose-hulman.edu/~yerricde/sig.html This is McAfee VirusScan. Add these two lines to your signature to prevent the spread of signature viruses. http://www.mcafee.com/