Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variadic GCD and LCM #275

Open
LePips opened this issue Dec 8, 2023 · 0 comments
Open

Variadic GCD and LCM #275

LePips opened this issue Dec 8, 2023 · 0 comments

Comments

@LePips
Copy link

LePips commented Dec 8, 2023

While #10 exists, I will use this as a separate tracker for these two algorithms and their variadic structure. Also inspired by Advent of Code 2023 Day 8 pt 2 which used the LCM of a collection of numbers.

The existing gcd can be made easily to take a variadic amount of values, along with some checks. lcm can also be implemented using the gcd method, also variadic.

It does allow 0 and 1 parameters, which are easy cases to account for. Just seems funky that one can put gcd() and lcm() 🤷, but these have sensible mathematical conventions.

@LePips LePips mentioned this issue Dec 8, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant