Hi suresh u r right whenever we declare any value float like a=0.7 then for the byte allocated it should be terminated within memory allocated otherwise it will be truncated 4 maximum possible value..like 0.699999999 ..so 0.6999 will never be equal to 0.7 so it will give different answer...for more clarification goto EXPLORING C by Y KANITKER most prob on 2nd or 3rd chapter this Qn is there in Exercise... .. take care bye
On Tue, 28 Dec 2004 15:30:28 +0530, Rohit PANDEY <[EMAIL PROTECTED]> wrote: > > > if(f<0.7) :: in this statment 0.7 is stored in double and its value > 0.7ABCDEFGH where A B C D are garbage.. > > so f must be less then 0.7 > -----Original Message----- > From: suresh kanna [mailto:[EMAIL PROTECTED] > Sent: Saturday, December 25, 2004 5:58 PM > To: [EMAIL PROTECTED] > Subject: (PT) Digest Number > > > > hai, > > Can anyone help me(explain) in this program! > > main() > > { > > float f= 0.7; > > if(f<0.7) > > {printf("The value less than 0.7");} > > else > > printf("The value greater "); > > } > > > > But the output appears as(the value less than 0.7) > > why soo?The system reconizess the value as 0.69999..i think so(not sure) > > Can anyone help me in this one...and explain y so! > > thank u, > > suresh kanna > > > > > > Yahoo! India Matrimony: Find your partner online. > > To unsubscribe : [EMAIL PROTECTED] > > > > > > > To unsubscribe : [EMAIL PROTECTED] > > > > > Yahoo! Groups Sponsor > ADVERTISEMENT > > ________________________________ > Yahoo! Groups Links > To visit your group on the web, go to: > http://groups.yahoo.com/group/Programmers-Town/ > > To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > ________________________________ > Yahoo! Groups Links > To visit your group on the web, go to: > http://groups.yahoo.com/group/Programmers-Town/ > > To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > > -- -------------------------------------------------------- Gaurav Mishra Software Engineer Binary Semantics Limited,Gurgaon ------------------------ Yahoo! Groups Sponsor --------------------~--> Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar. Now with Pop-Up Blocker. Get it for free! http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/EbFolB/TM --------------------------------------------------------------------~-> To unsubscribe : [EMAIL PROTECTED] Yahoo! Groups Links <*> To reply to this message, go to: http://groups.yahoo.com/group/Programmers-Town/post?act=reply&messageNum=4889 Please do not reply to this message via email. More information here: http://help.yahoo.com/help/us/groups/messages/messages-23.html <*> To visit your group on the web, go to: http://groups.yahoo.com/group/Programmers-Town/ <*> 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/
