Re: integer multiplication

2011-04-04 Thread casevh
On Apr 4, 9:41 am, Terry Reedy wrote: > On 4/4/2011 1:51 AM, Paul Rubin wrote: > > > I didn't realize Python used Karatsuba.  The main issue is probably that > > Python uses a straightforward portable C implementation that's not > > terribly efficient, > > but relatively easy for a couple of peopl

Re: integer multiplication

2011-04-04 Thread Terry Reedy
On 4/4/2011 1:20 PM, geremy condra wrote: On Mon, Apr 4, 2011 at 9:41 AM, Terry Reedy wrote: (I believe that retaining two implementations internally was considered but rejected. Could be wrong.) There are two implementations, grade school multiplication and karatsuba, which kicks in after

Re: integer multiplication

2011-04-04 Thread geremy condra
On Mon, Apr 4, 2011 at 9:41 AM, Terry Reedy wrote: > On 4/4/2011 1:51 AM, Paul Rubin wrote: > >> I didn't realize Python used Karatsuba.  The main issue is probably that >> Python uses a straightforward portable C implementation that's not >> terribly efficient, > > but relatively easy for a coupl

Re: integer multiplication

2011-04-04 Thread Terry Reedy
On 4/4/2011 1:51 AM, Paul Rubin wrote: I didn't realize Python used Karatsuba. The main issue is probably that Python uses a straightforward portable C implementation that's not terribly efficient, but relatively easy for a couple of people to maintain. For (C)Python 3, which no longer has a

Re: integer multiplication

2011-04-03 Thread Paul Rubin
geremy condra writes: >> Does anyone know what algorithms for integer multiplication does Python use? >> I am trying to compare it to those used by Sage as it seems like it takes >> much longer for Python to do large integer multiplication as compared to >> Sage (anyone know off the top of their h

Re: integer multiplication

2011-04-03 Thread geremy condra
On Sun, Apr 3, 2011 at 6:41 PM, Eddie Tsay wrote: > > On Sun, Apr 3, 2011 at 6:33 PM, geremy condra wrote: >> >> On Sun, Apr 3, 2011 at 6:20 PM, Eddie Tsay wrote: >> > Does anyone know what algorithms for integer multiplication does Python >> > use? >> > I am trying to compare it to those used b

Re: integer multiplication

2011-04-03 Thread geremy condra
On Sun, Apr 3, 2011 at 6:20 PM, Eddie Tsay wrote: > Does anyone know what algorithms for integer multiplication does Python use? > I am trying to compare it to those used by Sage as it seems like it takes > much longer for Python to do large integer multiplication as compared to > Sage (anyone kno