I am using following statements to print the first...

       scanf("%lf%lf",&n,&k);
       double v = n*log10(n);
       double dummy;
       double ff = modf(v,&dummy);
       double val = floor(pow(10.0,ff+k-1));
       printf("%.0f",val);


this code works fine when for big values of n like n=234232  , k=9      i
get value=943982129
but for even bigger numbers like n=457474575  ,k=9  i get value =278661176
which is not correct,i should get value=278660968

how to make above code produce more precise results...

-- 
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.

Reply via email to