This is the mail archive of the gcc-help@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: sqrt(x)


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


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