Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to do Factorials in VFP with Recursion
Message
De
21/02/2000 23:49:12
 
 
À
21/02/2000 22:53:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00335196
Message ID:
00335221
Vues:
20
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform