At 04:36 2007-02-17, Milan Babuskov wrote:
>kk_prajakta wrote:
> > long fact(int n)
> > {
> >
> >     long f;
> >     if(n== 0)
> >            return 1;
> >      else
> >            f = n*fact(n-1);
> >      return f;
> > }
>
>This wastes a lot of stack space for large numbers.

how large a number can you get a meaningful answer.... for a 64bit long
21 factorial won't fit
so 21 function frames isn't a LOT of stack space



>--
>Milan Babuskov
>http://www.guacosoft.com
>
>
>
>To unsubscribe, send a blank message to 
><mailto:[EMAIL PROTECTED]>.
>Yahoo! Groups Links
>
>
>

Victor A. Wagner Jr.      http://rudbek.com
The five most dangerous words in the English language:
               "There oughta be a law" 

Reply via email to