This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: sqrt(x)
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: tobaccofarm <phaceton at gmail dot com>, gcc-help at gcc dot gnu dot org
- Date: Sun, 15 May 2005 16:17:46 -0500
- Subject: Re: sqrt(x)
- References: <3655f5d905051508504f0d8540@mail.gmail.com>
Hi tobaccofarm,
In addition to what Wolfgang mentioned, the %f specifies a float, not a double. The %lf specifies a double (which you are using), and %Lf specifies a long double.
Since in C (as I recall, prehaps incorrectly), a float is promoted to a double before passing into the printf routine, I'm not sure if that means that %f and %lf have the same behavior. Just a FYI, in case it is relevant.
HTH,
--Eljay