On Sat, May 15, 2021 at 1:16 AM Michael Smith <mich...@smith-li.com> wrote: > > Jonathan Fine said > > But here there is a cost. Arbitrary precision arithmetic (and roots) uses > > more memory and takes longer. > > I think a wider (perhaps naive) interpretation of the idea could be, "can we > defer certain lossy calculations until they have to be done?" > > Fraction may do eager arbitrary precision arithmetic (I don't know), but is > it necessarily the case that integer division has to be eager? Could we have > our cake and eat it, too?
Well, integer division has to return *something*, there has to be a value for it. So the only benefit you might get would be that 10/8 could be stored as the fraction 10/8 instead of reducing it to 5/4, which would save some effort at the time of division at the cost of worsening addition. ChrisA _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/M2G56U35HRMKTT36AHGNVFSORQVALWBW/ Code of Conduct: http://python.org/psf/codeofconduct/