This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Floating point problems (accuracy).


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]