Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
?? Solve some Function : GCD/LCM...etc
Message
De
01/05/2011 09:54:36
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
?? Solve some Function : GCD/LCM...etc
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Application:
Desktop
Divers
Thread ID:
01508931
Message ID:
01508931
Vues:
113
Hi, all.
Happy The Holiday of Labors Day.
Foxer's WORKERS OF ALL LANDS UNITE.

I Need Function : GCD/LCM.

1. GCD
GCD = Greatest Common Divisor
Euclid's implementation of the greatest common divisor of two integers.
e.g
? F_GCD(9, 6) && Return : 3

2. LCM
LCM = Least Common Multiple
(LCM) is the smallest number that two or more numbers will divide into evenly.
? F_LCM(48, 42) && Return : 2

3. Solve : Indeterminate equation of the first degree
Finds the positive integral solutions of an indeterminate equation of the first degree of the form { a*X + b*Y = c }
if can DO, then :
Fx(Max) = ? and Fy(Max) = ?
or
Fx(Min) = ? and Fy(Min) = ?
X = ? and Y = ?
e.g :
if :
X + 3Y = 12
Result :
X = 9, Y = 1
X = 6, Y = 2
X = 3, Y = 3

How to ?

VFP Code/Sample

Thanks

FpxPro Funs

- Tuberose
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform