Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do Factorials in VFP with Recursion
Message
From
21/02/2000 23:49:12
 
 
To
21/02/2000 22:53:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00335196
Message ID:
00335221
Views:
19
May I say that factorials are the best example for where to not use recursion? Here's a much simplier, faster
and cmore compact version: <g>
func Factorial
lparam tnNumber
local lnResult
lnResult = 1
for lnI = 2 to tnNumber
   lnResult = lnResult * lnI
endfor
return lnResult
Vlad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform