Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -1,17 +1,29 @@
|
|||
Procedure GCDiv(a, b); Euclidean algorithm
|
||||
Protected r
|
||||
While b
|
||||
r = b
|
||||
b = a%b
|
||||
a = r
|
||||
Wend
|
||||
ProcedureReturn a
|
||||
Procedure GCDiv(a.q, b.q); Euclidean algorithm
|
||||
a = Abs(a)
|
||||
b = Abs(b)
|
||||
If a = 0
|
||||
ProcedureReturn b
|
||||
ElseIf b = 0
|
||||
ProcedureReturn a
|
||||
Else
|
||||
Protected r.q
|
||||
While b
|
||||
r = b
|
||||
b = a % b
|
||||
a = r
|
||||
Wend
|
||||
ProcedureReturn a
|
||||
EndIf
|
||||
EndProcedure
|
||||
|
||||
Procedure LCM(m,n)
|
||||
Protected t
|
||||
If m And n
|
||||
t=m*n/GCDiv(m,n)
|
||||
Procedure LCM(m.d, n.d)
|
||||
m = Abs(m)
|
||||
n = Abs(n)
|
||||
If m = 0
|
||||
ProcedureReturn n
|
||||
ElseIf n = 0
|
||||
ProcedureReturn m
|
||||
Else
|
||||
ProcedureReturn m / GCDiv(m, n) * n
|
||||
EndIf
|
||||
ProcedureReturn t*Sign(t)
|
||||
EndProcedure
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue