And yes corrct me if i am wrong in the assertion that the code wont work On Fri, May 13, 2011 at 7:24 PM, saurabh singh <saurab...@gmail.com> wrote:
> No Amir,it wont.We will not be able to store each and every digit in the > double though > Check out ieee floating point standard,that will clarify it. > But yes in the context of above problem the code wont work i think due to > precision problem....... > > > On Fri, May 13, 2011 at 5:12 PM, Aamir Khan <ak4u2...@gmail.com> wrote: > >> double n will overflow... >> >> On 5/13/11, bittu <shashank7andr...@gmail.com> wrote: >> > @Dave... I think 1 Googol Year is =10^100 not 10^116.5 ?? why u have >> > used >> > >> > so then we have to write the single line program that googol years of >> > time ?? & we have processor that can execute the instruction in 10^9 >> > per second so the time required by googol year in second >> > which is equals to time t=pow(10,109)*365*86400 sec. >> > >> > so program is like >> > >> > #include <stdio.h> >> > #include <math.h> >> > >> > int main() { >> > >> > double n = pow(10, 109) * 365 * 86400; >> > >> > while(n--); >> > } >> > >> > Correct me if anything wrong??? >> > >> > Thanks & Regards >> > Shashank Mani>>"The Best Way To Escape From The problem is Solve It" >> > Computer Science & Engg. >> > BIT Mesra >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "Algorithm Geeks" group. >> > To post to this group, send email to algogeeks@googlegroups.com. >> > To unsubscribe from this group, send email to >> > algogeeks+unsubscr...@googlegroups.com. >> > For more options, visit this group at >> > http://groups.google.com/group/algogeeks?hl=en. >> > >> > >> >> >> -- >> Aamir Khan >> Indian Institute of Technology Roorkee, >> Roorkee, Uttarakhand, >> India , 247667 >> Phone: +91 9557647357 >> email: aami...@iitr.ernet.in <aamir...@iitr.ernet.in> >> ak4u2...@gmail.com >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > > > -- > Saurabh Singh > B.Tech (Computer Science) > MNNIT ALLAHABAD > > > -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.