matqkks
- 283
- 6
Do they use the Euclidean Algorithm?
The discussion centers on how computers evaluate the greatest common divisor (GCD) of two integers, exploring various algorithms and programming considerations. The scope includes theoretical algorithms, practical programming approaches, and performance implications.
Participants express differing views on the algorithms used for GCD computation, with no consensus on a single method or approach being universally accepted.
Some limitations include the potential for varying performance based on the algorithm chosen and the input size, as well as the dependence on specific programming implementations.
Readers interested in computer science, algorithm design, programming practices, and mathematical software development may find this discussion relevant.
You still need some sort of division to calculate how much you have to subtract. Simply subtracting the smaller number from the larger number repeatedly has a really bad worst-case runtime if the numbers are very different (exponential, while divisions make the method scale with the input length squared).jedishrfu said:I imagine math software would use this algorithm to compute it as subtractions are relatively cheap compared to multiplications or divisions.