Floating point problems (accuracy).

Chris Lattner sabre@nondot.org
Tue Jan 18 22:55:00 GMT 2005


On Tue, 18 Jan 2005, Richard Henderson wrote:

> On Tue, Jan 18, 2005 at 03:38:33PM -0600, Chris Lattner wrote:
>> Note that this is severely slow down your code if it is FP intensive, but
>> it will produce correct results.
>
> Modulo double rounding of course.

Care to elaborate?

   double X = ..
   float F1 = (float)(float)D;
   float F2 = (float)(double)(float)D;
   float F3 = (float)D;

Aren't F1, F2, and F3 identical?

-Chris

-- 
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/



More information about the Gcc mailing list