This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc compilation on amd opteron and precision
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Muge Unel <m dot unel1 at physics dot ox dot ac dot uk>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sat, 07 May 2005 14:48:34 +0100
- Subject: Re: gcc compilation on amd opteron and precision
- References: <E52BF3D921F7284CBE8963359F0CA7A9010543DB@exchng3.physics.ox.ac.uk>
Muge Unel wrote:
p= (long double) 1.0 / (long double) 3.0;
q = (long double) p * (long double) 3.0 - (long double) 1.0;
printf ("1 /3 is: %.30e\n", p);
printf ("(1 / 3) x 3 - 1 is: %.30e\n", q);
you probably want %.30Le format if p and q are indeed long doubles,
as man -S3 printf tells you.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk