- #1
- 285
- 5
Do they use the Euclidean Algorithm?
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.