Re: [Python-Dev] 64 bit units in PyLong

2017-07-05 Thread Gregory P. Smith
On Wed, Jul 5, 2017 at 12:05 PM Mark Dickinson wrote: > On Mon, Jul 3, 2017 at 5:52 AM, Siyuan Ren wrote: > > The current PyLong implementation represents arbitrary precision > integers in > > units of 15 or 30 bits. I presume the purpose is to avoid

Re: [Python-Dev] 64 bit units in PyLong

2017-07-05 Thread Chris Angelico
On Thu, Jul 6, 2017 at 5:33 AM, Mark Lawrence via Python-Dev wrote: > On 05/07/2017 20:05, Mark Dickinson wrote: > >> Oh, and you'd have to rewrite the power algorithm, which currently >> depends on the size of a limb in bytes being a multiple of 5. :-) >> > > What is a

Re: [Python-Dev] 64 bit units in PyLong

2017-07-05 Thread Mark Lawrence via Python-Dev
On 05/07/2017 20:05, Mark Dickinson wrote: Oh, and you'd have to rewrite the power algorithm, which currently depends on the size of a limb in bytes being a multiple of 5. :-) What is a limb, as my search foo has let me down? -- My fellow Pythonistas, ask not what our language can do for

Re: [Python-Dev] 64 bit units in PyLong

2017-07-05 Thread Mark Dickinson
On Mon, Jul 3, 2017 at 5:52 AM, Siyuan Ren wrote: > The current PyLong implementation represents arbitrary precision integers in > units of 15 or 30 bits. I presume the purpose is to avoid overflow in > addition , subtraction and multiplication. But compilers these days