Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor optimization for Fractions.limit_denominator
When we construct the upper and lower candidates in limit_denominator, the numerator and denominator are already relatively prime (and the denominator positive) by construction, so there's no need to go through the usual normalisation in the constructor. This saves a couple of potentially expensive gcd calls. Suggested by Michael Scott Asato Cuthbert in pythonGH-93477.
- Loading branch information