Newsgroups: comp.arch Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: negative addresses (really unsigned arithmetic) Message-ID: <1988May15.220044.12987@utzoo.uucp> Organization: U of Toronto Zoology References: <2393@uvacs.CS.VIRGINIA.EDU> <9485@apple.Apple.Com>, <11571@ut-sally.UUCP> Date: Sun, 15 May 88 22:00:44 GMT > Your CS background is showing, gentlemen. When I gather data from stars, I > count the precious photons one at a time, and use unsigned arithmetic to > massage them, since there are no negative photons... Your lack of CS background is showing, Ed. :-) Just because your numbers are always positive doesn't mean you should use unsigned data types for them. As people have already pointed out, nasty surprises lurk in unsigned arithmetic, and it is potentially less efficient to boot (although on most machines the difference, if any, is slight). The only compelling reason to use unsigned data types for ordinary arithmetic purposes is if you really need that one extra bit... and if that's the case, you're probably better off using some sort of multi-precision arithmetic package anyway, because sooner or later you'll need another bit. -- NASA is to spaceflight as | Henry Spencer @ U of Toronto Zoology the Post Office is to mail. | {ihnp4,decvax,uunet!mnetor}!utzoo!henry