X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Martin Ambuhl Newsgroups: comp.os.msdos.djgpp Subject: Re: double Date: Fri, 22 Feb 2008 02:32:20 -0500 Lines: 14 Message-ID: <627c49F220tsiU1@mid.individual.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net YXpjIs4/8jara61Lm+O9YwgN+OFNBKoBEqklAgsvLoTeY92N9R Cancel-Lock: sha1:xLFMtHQgJTySGGU0fcCwXXotzIM= User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) In-Reply-To: To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Sterten AT aol DOT com wrote: > double x; > int main(int argc,char*argv[]){ > x=1.23; > printf("x=%13.12Lf\n",x); > } > > prints x=0.000000000000 instead of x=1.230000000000 > what's wrong ? "%Lf" is the specifier for a long double without exponent. x is not a long double; it is a double. "%f" is the printf specifier for a double without exponent (the scanf specifier "%lf" is acceptable for printf under the C99 standard).