Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!kddlab!titcca!sragwa!wsgw!socslgw!diamond!diamond From: diamond@diamond.csl.sony.junet (Norman Diamond) Newsgroups: comp.lang.c Subject: Re: Math functions (was Re: C optimizer) Message-ID: <10134@socslgw.csl.sony.JUNET> Date: 15 Feb 89 01:05:01 GMT References: <515@larry.UUCP> <795@atanasoff.cs.iastate.edu> Sender: news@csl.sony.JUNET Reply-To: diamond@diamond. (Norman Diamond) Distribution: comp Organization: /usr/lib/news/organization Lines: 26 news@beaver.cs.washington.edu writes: > Even if the compiler knew something about the math functions (i.e. they are > not going to do i/o with the user) it still might have to generate the calls. > I have heard that for math libraries to be IEEE conformant they must round > up and down on .5 *randomly* with a uniform distribution. I was floored when > I heard this. Anyone know if it is actually true? 'fraid I don't know if it's true, but if it is, the IEEE should send someone back to school for grade 9 arithmetic. (So should many other organizations though.) xxxxx.5 should be rounded to an EVEN number, xxxxx or xxxxx+1 (all of these numbers scaled by whatever exponent). In binary, .bbbb01 becomes .bbbb0 and .bbbb11 becomes .cccc0 where .cccc0 == .bbbb0 + .00010 (and if there is an overflow, then the 1.cccc gets shifted down). > "Security and Liberty are at war. Which side are you on?" I'm on each person's side. If you want security, feel free to do your best, but don't interfere with someone else's liberty, as long as they don't inter- fere with yours.... Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.jp@relay.cs.net) The above opinions are my own. | Why are programmers criticized for If they're also your opinions, | re-inventing the wheel, when car you're infringing my copyright. | manufacturers are praised for it?