Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
|
|
@ -0,0 +1,12 @@
|
|||
func gcd a b .
|
||||
while b <> 0
|
||||
h = b
|
||||
b = a mod b
|
||||
a = h
|
||||
.
|
||||
return a
|
||||
.
|
||||
func lcm a b .
|
||||
return a / gcd a b * b
|
||||
.
|
||||
print lcm 12 18
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import extensions;
|
||||
import system'math;
|
||||
|
||||
gcd = (m,n => (n == 0) ? (m.Absolute) : (gcd(n,n.mod:m)));
|
||||
gcd = (m,n => (n == 0) ? (m.Absolute) : (gcd(n,n.mod(m))));
|
||||
|
||||
lcm = (m,n => (m * n).Absolute / gcd(m,n));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue