All of lore.kernel.org
 help / color / mirror / Atom feed
* float
@ 2010-01-08 16:30 phoenixxz
  2010-01-08  4:42 ` float Bryan Christ
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: phoenixxz @ 2010-01-08 16:30 UTC (permalink / raw)
  To: linux-c-programming

float i=1.34;
printf("%f",i);


->> 0
why?

^ permalink raw reply	[flat|nested] 20+ messages in thread
* float
@ 2011-01-11  7:38 ratheesh k
  2011-01-11  7:46 ` float Thomas Weber
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: ratheesh k @ 2011-01-11  7:38 UTC (permalink / raw)
  To: linux-c-programming

I could not understand  why it getting printed like this. Could any
body tell me.

#include <stdio.h>

int main()
{
        float f=0.0f;
        int i;

        for(i=0;i<10;i++)
                f = f + 0.1f;

        if(f == 1.0f)
                printf("f is 1.0 \n");
        else
                printf("f is NOT 1.0\n");

        return 0;
}

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2011-01-11  8:57 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-08 16:30 float phoenixxz
2010-01-08  4:42 ` float Bryan Christ
2010-01-08 16:45   ` float Fawad Lateef
2010-01-08 16:40 ` float Nanakos Chrysostomos
2010-01-08 16:44 ` float Fawad Lateef
2010-01-08 16:47 ` float Nanakos Chrysostomos
2010-01-08 17:11   ` float Michal Nazarewicz
2010-01-08 17:19     ` float Nanakos Chrysostomos
2010-01-08 17:21     ` float Nanakos Chrysostomos
2010-01-08 17:43       ` float Michal Nazarewicz
2010-01-08 18:00 ` float andrej.gelenberg
2010-01-08 22:05 ` float Glynn Clements
2011-01-11  7:38 float ratheesh k
2011-01-11  7:46 ` float Thomas Weber
2011-01-11  7:56   ` float Amit Virdi
2011-01-11  7:55 ` float Uriel Corfa
2011-01-11  8:01   ` float Thomas Weber
2011-01-11  8:34     ` float ratheesh k
2011-01-11  8:57       ` float Thomas Weber
2011-01-11  8:38 ` float Andrej Gelenberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.