Path: utzoo!attcan!uunet!cs.utexas.edu!rice!sun-spots-request From: ccettix!boissier@cs.utexas.edu (franck boissiere) Newsgroups: comp.sys.sun Subject: Re: What is the _REAL_ SunSparc1 sound-format?!? Keywords: Miscellaneous Message-ID: <8848@brazos.Rice.edu> Date: 14 Jun 90 11:32:53 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 20 Approved: Sun-Spots@rice.edu X-Refs: Original: v9n213 X-Sun-Spots-Digest: Volume 9, Issue 213, message 4 From article <8823@brazos.Rice.edu>, by andrew@ambra.dk (Leif Andrew Rump): > > main() > { > char tmp; > > while ((tmp = getchar()) != EOF) > printf("%c", (tmp < 0) ? tmp : 128 - tmp); > } > > I don't understand the: (tmp < 0) ? 128 - tmp : tmp; part. If I don't do You'd better use bit masks rather than arithmetics. tmp & 128 means something (i.e. the eighth bit is set) and tmp & 127 means only the seven first bits are meaningful Franck BOISSIERE boissier@irisa.irisa.fr Prototyping Lab Manager boissier@ccettix.UUCP C.C.E.T.T. B.P. 59 boissier%irisa.irisa.fr@uunet.uu.net 35512 CESSON SEVIGNE CEDEX FRANCE