Path: utzoo!attcan!uunet!husc6!mailrus!tut.cis.ohio-state.edu!osu-cis!att!ihnp4!ihlpg!tainter From: tainter@ihlpg.ATT.COM (Tainter) Newsgroups: comp.arch Subject: Re: negative addresses (really unsigned arithmetic) Message-ID: <5364@ihlpg.ATT.COM> Date: 16 May 88 22:29:23 GMT References: <2393@uvacs.CS.VIRGINIA.EDU> <9485@apple.Apple.Com> <11592@ut-sally.UUCP> Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 25 In article <965@cresswell.quintus.UUCP>, ok@quintus.UUCP (Richard A. O'Keefe) writes: > I don't imagine that Ed Nather likes it when his counts > silently wrap around from 65535 to 0, but that's "unsigned" arithmetic > for you. > (2) I am getting sick of computers which cannot do integer arithmetic > and won't admit their mistakes. Floating-point was bad enough, > but when a computer will add 1 to a positive number and give me > a negative number it's time we cleaned up our act. It can also give you overflow if your language allows for detecting it. Don't blaim the machine! If you need to detect this and your language doesn't allow it then you need a different language. Also, There is nothing stopping the implementers from making unsigned arithmetic (with a loss of a bit of precision) out of signed numbers. One simply detects the sign change and zeros out the value. Ta da, unsigned arithmetic the way it is defined now. I wouldn't quibble about that extra bit either, no matter how many bits of width you give your integers, there is someone who needs more. Currently, 31 bits is probably just as sufficient as 32 bits. 47 will probably do just as well as 48, 63 as 64, etc. --j.a.tainter