Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!amdcad!crackle!tim From: tim@crackle.amd.com (Tim Olson) Newsgroups: comp.lang.c Subject: Re: Math functions (was Re: C optimizer) Message-ID: <24436@amdcad.AMD.COM> Date: 14 Feb 89 05:38:38 GMT References: <515@larry.UUCP> <795@atanasoff.cs.iastate.edu> Sender: news@amdcad.AMD.COM Reply-To: tim@amd.com (Tim Olson) Distribution: comp Organization: Advanced Micro Devices, Inc. Sunnyvale CA Lines: 20 Summary: Expires: Sender: Followup-To: In article jeff@stormy.atmos.washington.edu (Jeff L. Bowden) 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? P854 only specifies that conforming implementations provide add, subtract, multiply, divide, square-root, remainder, round-to-integer in floating-point format, conversions, and comparisons. For these operations, the result must be infinitely-precise, modified by the rounding mode in effect. There is no "random" rounding mode. For "round to nearest" (the default), if the two nearest representable values are equally near, the one with its least significant bit zero is delivered. -- Tim Olson Advanced Micro Devices (tim@crackle.amd.com)