17 lines
256 B
Text
17 lines
256 B
Text
Procedure GCDiv(a, b); Euclidean algorithm
|
|
Protected r
|
|
While b
|
|
r = b
|
|
b = a%b
|
|
a = r
|
|
Wend
|
|
ProcedureReturn a
|
|
EndProcedure
|
|
|
|
Procedure LCM(m,n)
|
|
Protected t
|
|
If m And n
|
|
t=m*n/GCDiv(m,n)
|
|
EndIf
|
|
ProcedureReturn t*Sign(t)
|
|
EndProcedure
|