This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Sergey.Kirpichev
Recipients Sergey.Kirpichev
Date 2021-03-06.14:18:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1615040297.73.0.541090358152.issue43420@roundup.psfhosted.org>
In-reply-to
Content
fractions.py uses naive algorithms for doing arithmetics.

It may worth implementing less trivial versions for addtion/substraction
and multiplication (e.g. Henrici algorithm and so on), described here:
https://www.eecis.udel.edu/~saunders/courses/822/98f/collins-notes/rnarith.ps
as e.g gmplib does: https://gmplib.org/repo/gmp/file/tip/mpq/aors.c

Some projects (e.g. SymPy here: https://github.com/sympy/sympy/pull/12656) reinvent
the stdlib's Fraction just to add such simple improvements.  With big denominators (~10**6)
this really does matter, my local benchmarks suggest the order of magnitude difference for
summation of several such numbers.
History
Date User Action Args
2021-03-06 14:18:17Sergey.Kirpichevsetrecipients: + Sergey.Kirpichev
2021-03-06 14:18:17Sergey.Kirpichevsetmessageid: <1615040297.73.0.541090358152.issue43420@roundup.psfhosted.org>
2021-03-06 14:18:17Sergey.Kirpichevlinkissue43420 messages
2021-03-06 14:18:17Sergey.Kirpichevcreate