retroforth/example/GCD.forth

13 lines
198 B
Text
Raw Normal View History

# example|GreatestCommonDivisor
Declare module constant (prevents reloading when using `import`):
````
:example|GreatestCommonDivisor ;
````
````
:gcd (ab-n)
[ tuck mod dup ] while drop ;
````