General information
Category:
Coding, syntax & commands
Title:
?? Solve some Function : GCD/LCM...etc
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only