Movatterモバイル変換
[0]ホーム
[Python-Dev] Re: PEP239 (Rational Numbers) Reference Implementation and new issues
Steve Holdensholden@holdenweb.com
Thu, 3 Oct 2002 08:52:01 -0400
Christian Tismer <tismer@tismer.com> wrote ...> Andrew Koenig wrote:[rational representations]> > Seriously, I don't know whether it would help in practice.> > It might be that normalizing rationals from time to time would> > be enough.>> Ok, not just zeros, but normalizing the fraction to no> common denominator. That makes sense if lots of small> numbers/fractions were multiplied and prime factors> pile up.> Not so with addition. This creates completely different> prime factors all the time, and addition becomes much> more expensive than multiplication when the common> denominator must always be reduced to the minimum.>> gotta-be-expensive -- chris>Next someone will suggest that we store rationals as a sequence ofcoefficients of the prime factors. This would make primes really easy torecognise (since they'd be a sequence of zeros followed by a one with asingle one as denominator).but-it-might-slow-down-other-operations-a-bit-ly y'rs - steve-----------------------------------------------------------------------Steve Holdenhttp://www.holdenweb.com/Python Web Programminghttp://pydish.holdenweb.com/pwp/Previous .sig file retired to www.homeforoldsigs.com-----------------------------------------------------------------------
[8]ページ先頭