calc GCD (greatest common divisor) and LCM (least common multiple) inside gen~
Dear Friends
Can I calc - as mentioned in the topic's title - GCD (greatest common divisor) and LCM (least common multiple) of two values inside gen~?
thanks in advance for any indications
You'll need to use a codebox, as these require an iterative procedure, i.e. a for loop, and then implement one of the typical algorithms. Once you have GCD, LCM is easy:
Max Patch
Copy patch and select New From Clipboard in Max.
That's really elegant. Thank you so much, Graham.
GCD = % until rest is 0, then it is the last div?
R, That would be the implication of Graham's gen patch that I used.