18 lines
242 B
Text
18 lines
242 B
Text
|
# example|LeastCommonMultiple
|
||
|
|
||
|
Declare module constant (prevents reloading when using `import`):
|
||
|
|
||
|
````
|
||
|
:example|LeastCommonMultiple ;
|
||
|
````
|
||
|
|
||
|
----
|
||
|
|
||
|
````
|
||
|
:gcd (ab-n)
|
||
|
[ tuck mod dup ] while drop ;
|
||
|
|
||
|
:lcm (ab-n)
|
||
|
dup-pair gcd [ * ] dip / ;
|
||
|
````
|