Good, try this...
Than make N= 150, OOps....
E.
LOCAL N, nT
CLEAR
N= 100
nT= SYS(2)
? nFactorial( N )
? SYS(2) - nT
nT= SYS(2)
? nProcedure( N )
? SYS(2) - nT
*******
FUNCTION nFactorial( N )
LOCAL I
IF N > 1
I= N * nFactorial( N - 1 )
ELSE
RETURN 1
ENDIF
RETURN I
*******
FUNCTION nProcedure( N )
LOCAL I, J
J= 1
FOR i=1 TO N
j= j * I
NEXT
RETURN J
On Aug 31, 2010, at 2:07 PM, Eurico Chagas Filho wrote:
> You can do it using recursion or not, right ?
Do what?
> Well using recursion u can get stack overflow.
Well, sure, any programming technique done wrong can cause a crash.
> And it will take longer when u use recursion, right ?
Only if the programmer is incompetent.
> So why bother ? Because it is fashion ?
Because a) it works extremely well for processing tree-like data structures
and b) it creates simpler code, as each level is conceptually the same as the
others, so the complexity of nesting is removed.
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.