This is the mail archive of the
mailing list for the GCC project.
Re: Floating point problems (accuracy).
- From: Chris Lattner <sabre at nondot dot org>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Phil Prentice <philp dot cheer at btinternet dot com>,James E Wilson <wilson at specifixinc dot com>, gcc at gcc dot gnu dot org,mike at stec dot clara dot co dot uk, gcc-help at gcc dot gnu dot org
- Date: Tue, 18 Jan 2005 16:31:05 -0600 (CST)
- Subject: Re: Floating point problems (accuracy).
- References: <Pine.LNX.firstname.lastname@example.org><20050118222752.GA5163@redhat.com>
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?