Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
?? Solve some Function : GCD/LCM...etc
Message
From
01/05/2011 09:54:36
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
?? Solve some Function : GCD/LCM...etc
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Application:
Desktop
Miscellaneous
Thread ID:
01508931
Message ID:
01508931
Views:
111
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
Map
View

Click here to load this message in the networking platform