Re: long number multiplication

2004-12-07 Thread Nick Coghlan
Christopher A. Craig wrote: i needed to implement this myself and was thinking of storing the digits of an integer in a list. That's sort of what Python does except the "digits" are 15 bits, not base 10. Doing it in base 10 would be a huge pain because of the problems with base 10->base 2 conver

Re: long number multiplication

2004-12-06 Thread Christopher A. Craig
"I.V. Aprameya Rao" <[EMAIL PROTECTED]> writes: > i have been wondering, how does python store its very long integers and > perform aritmetic on it. In CPython, A long integer is a combination of a signed word indicating the sign and the size and an unsigned array of N words where N is the absol

Re: long number multiplication

2004-12-06 Thread Michael Hudson
"Terry Reedy" <[EMAIL PROTECTED]> writes: > "I.V. Aprameya Rao" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > i have been wondering, how does python store its very long integers and > > perform aritmetic on it. Well, up until fair recently it used "high school" arithmetic in

Re: long number multiplication

2004-12-06 Thread Nick Craig-Wood
I.V. Aprameya Rao <[EMAIL PROTECTED]> wrote: > i have been wondering, how does python store its very long integers and > perform aritmetic on it. > > i needed to implement this myself and was thinking of storing the digits > of an integer in a list. > > however this would be very slow for

Re: long number multiplication

2004-12-05 Thread Jeremy Bowers
On Sun, 05 Dec 2004 09:02:18 +0530, I.V. Aprameya Rao wrote: > i have been wondering, how does python store its very long integers and > perform aritmetic on it. > > i needed to implement this myself and was thinking of storing the digits > of an integer in a list. Uh, why? What possible enviro

Re: long number multiplication

2004-12-04 Thread Nick Coghlan
I.V. Aprameya Rao wrote: hi i have been wondering, how does python store its very long integers and perform aritmetic on it. i needed to implement this myself and was thinking of storing the digits of an integer in a list. however this would be very slow for operations like division etc. so if

Re: long number multiplication

2004-12-04 Thread Terry Reedy
"I.V. Aprameya Rao" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > i have been wondering, how does python store its very long integers and > perform aritmetic on it. The only real documention for stuff like this, other than random posts on c.l.p., is the source code itself. It i