Re: float

Michal Nazarewicz <[email protected]>
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <[email protected]>
> On 8/1/2010 18:30, phoenixxz wrote:
>> float i=1.34;
>> printf("%f",i);
>>
>> ->> 0
>> why?

Nanakos Chrysostomos <[email protected]> writes:
> printf("%lf",i);

%lf is actually invalid format (though glibc will gladly treat it the
 same way it treats %f).  When passing a float value to a function with
 variable number of arguments it is promoted to double.

-- 
Best regards,                                         _     _
 .o. | Liege of Serenly Enlightened Majesty of      o' \,=./ `o
 ..o | Computer Science,  Michal "mina86" Nazarewicz   (o o)
 ooo +--<mina86*tlen.pl>--<jid:mina86*jabber.org>--ooO--(_)--Ooo--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.