@Aamir: No, it won't overflow. The maximum double is approximately 10^307.95. His value is well within the range of doubles. The problem is that doubles don't have enough precision. See my preceding post for an explanation.
Dave On May 13, 6:42 am, 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- Hide quoted text - > > - Show quoted text - -- 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.