You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 thegcd
method, also variadic.It does allow 0 and 1 parameters, which are easy cases to account for. Just seems funky that one can putgcd()
andlcm()
🤷, but these have sensible mathematical conventions.The text was updated successfully, but these errors were encountered: