Re: Initialization and Floating Problem.
"kedarpathikonda" <[email protected]>
| Newsgroups | gmane.comp.programming.cppug |
|---|---|
| Message-ID | <[email protected]> |
2.
> float c=0.7;
> if(c<0.7)
> printf("yes");
> else
> printf("no");
>
> output:-yes
> if i write c<0.7f then it
> prints no.
> i would like to know the reason
> behind this i.e
> what's happening internally.
the reason is because if give if(c<0.7) it will take 0.7 as double by
default
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/EbFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/cppug/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/