Re: Linear time baseconversion

2015-06-30 Thread Christian Gollwitzer
Am 30.06.15 um 18:34 schrieb Ian Kelly: On Tue, Jun 30, 2015 at 10:10 AM, Chris Angelico wrote: When there's a simple ratio between the bases, it's fairly straight-forward to convert a few digits at a time. Converting base 256 into base 64, for instance, can be done by taking three digits and y

Re: Linear time baseconversion

2015-06-30 Thread Christian Gollwitzer
Am 30.06.15 um 17:40 schrieb Ian Kelly: On Tue, Jun 30, 2015 at 3:07 AM, Christian Gollwitzer wrote: Concerning the algorithmic complexity, it can't be faster than square time in the number of digits N. Baseconversion needs to do a sequence of division operations, where every operation gves you

Re: Linear time baseconversion

2015-06-30 Thread Michael Torrie
On 06/30/2015 10:24 AM, jonas.thornv...@gmail.com wrote: > Den tisdag 30 juni 2015 kl. 18:12:46 UTC+2 skrev Michael Torrie: >> Do you have some Python code to show us? > > No i just thought you would find the digit search algorithm interesting. Yeah it is interesting, although I didn't really see

Re: Linear time baseconversion

2015-06-30 Thread Ian Kelly
On Tue, Jun 30, 2015 at 10:10 AM, Chris Angelico wrote: > When there's a simple ratio between the bases, it's fairly > straight-forward to convert a few digits at a time. Converting base > 256 into base 64, for instance, can be done by taking three digits and > yielding four. But within that, you

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 18:12:46 UTC+2 skrev Michael Torrie: > Do you have some Python code to show us? No i just thought you would find the digit search algorithm interesting. -- https://mail.python.org/mailman/listinfo/python-list

Re: Linear time baseconversion

2015-06-30 Thread Michael Torrie
Do you have some Python code to show us? -- https://mail.python.org/mailman/listinfo/python-list

Re: Linear time baseconversion

2015-06-30 Thread Chris Angelico
On Wed, Jul 1, 2015 at 1:45 AM, Ian Kelly wrote: > On Tue, Jun 30, 2015 at 9:40 AM, Ian Kelly wrote: >> On Tue, Jun 30, 2015 at 3:07 AM, Christian Gollwitzer >> wrote: >>> Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: It still bug out on very big numbers if base outside inte

Re: Linear time baseconversion

2015-06-30 Thread Ian Kelly
On Tue, Jun 30, 2015 at 3:07 AM, Christian Gollwitzer wrote: > Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: >> >> It still bug out on very big numbers if base outside integer scope. >> I am very keen on suggestions regarding the logic to make it faster. > > > Concerning the algorithmic

Re: Linear time baseconversion

2015-06-30 Thread Ian Kelly
On Tue, Jun 30, 2015 at 9:40 AM, Ian Kelly wrote: > On Tue, Jun 30, 2015 at 3:07 AM, Christian Gollwitzer wrote: >> Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: >>> >>> It still bug out on very big numbers if base outside integer scope. >>> I am very keen on suggestions regarding the l

Re: Linear time baseconversion

2015-06-30 Thread Ian Kelly
On Tue, Jun 30, 2015 at 8:13 AM, wrote: >> Regarding the time it seem to double the digits quadruple the time. And that >> is still linear or? > > 2x seem linear to me? That's not linear, nor is it "2x". If doubling the size of the input quadruples the time, then doubling the size of the input

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 15:22:44 UTC+2 skrev jonas.t...@gmail.com: > Den tisdag 30 juni 2015 kl. 11:43:55 UTC+2 skrev jonas.t...@gmail.com: > > Den tisdag 30 juni 2015 kl. 11:35:06 UTC+2 skrev jonas.t...@gmail.com: > > > Den tisdag 30 juni 2015 kl. 11:08:01 UTC+2 skrev Christian Gollwitzer: > >

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 11:43:55 UTC+2 skrev jonas.t...@gmail.com: > Den tisdag 30 juni 2015 kl. 11:35:06 UTC+2 skrev jonas.t...@gmail.com: > > Den tisdag 30 juni 2015 kl. 11:08:01 UTC+2 skrev Christian Gollwitzer: > > > Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: > > > > It still b

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 11:35:06 UTC+2 skrev jonas.t...@gmail.com: > Den tisdag 30 juni 2015 kl. 11:08:01 UTC+2 skrev Christian Gollwitzer: > > Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: > > > It still bug out on very big numbers if base outside integer scope. > > > I am very keen

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 11:08:01 UTC+2 skrev Christian Gollwitzer: > Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: > > It still bug out on very big numbers if base outside integer scope. > > I am very keen on suggestions regarding the logic to make it faster. > > Concerning the algor

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 11:08:01 UTC+2 skrev Christian Gollwitzer: > Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: > > It still bug out on very big numbers if base outside integer scope. > > I am very keen on suggestions regarding the logic to make it faster. > > Concerning the algor

Re: Linear time baseconversion

2015-06-30 Thread Christian Gollwitzer
Am 30.06.15 um 10:52 schrieb jonas.thornv...@gmail.com: It still bug out on very big numbers if base outside integer scope. I am very keen on suggestions regarding the logic to make it faster. Concerning the algorithmic complexity, it can't be faster than square time in the number of digits N.

Re: Linear time baseconversion

2015-06-30 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 02:09:17 UTC+2 skrev Ben Bacarisse: > Ian Kelly writes: > > > On Mon, Jun 29, 2015 at 4:56 PM, Ian Kelly wrote: > >> On Mon, Jun 29, 2015 at 4:39 PM, wrote: > >>> http://jt.node365.se/baseconversion8.html > > > By the way, I think you have a bug. I did my time test

Re: Linear time baseconversion

2015-06-29 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 01:11:51 UTC+2 skrev Ian: > On Mon, Jun 29, 2015 at 4:56 PM, Ian Kelly wrote: > > On Mon, Jun 29, 2015 at 4:39 PM, wrote: > >> http://jt.node365.se/baseconversion8.html > > > > Back of the envelope mental calculation, that appears to be quadratic, > > not linear. Doub

Re: Linear time baseconversion

2015-06-29 Thread Ben Bacarisse
Ian Kelly writes: > On Mon, Jun 29, 2015 at 4:56 PM, Ian Kelly wrote: >> On Mon, Jun 29, 2015 at 4:39 PM, wrote: >>> http://jt.node365.se/baseconversion8.html > By the way, I think you have a bug. I did my time testing by > concatenating the default input number to itself several times. At >

Re: Linear time baseconversion

2015-06-29 Thread jonas . thornvall
Den tisdag 30 juni 2015 kl. 01:11:51 UTC+2 skrev Ian: > On Mon, Jun 29, 2015 at 4:56 PM, Ian Kelly wrote: > > On Mon, Jun 29, 2015 at 4:39 PM, wrote: > >> http://jt.node365.se/baseconversion8.html > > > > Back of the envelope mental calculation, that appears to be quadratic, > > not linear. Doub

Re: Linear time baseconversion

2015-06-29 Thread Ian Kelly
On Mon, Jun 29, 2015 at 4:56 PM, Ian Kelly wrote: > On Mon, Jun 29, 2015 at 4:39 PM, wrote: >> http://jt.node365.se/baseconversion8.html > > Back of the envelope mental calculation, that appears to be quadratic, > not linear. Doubling the length of the input results in an approximate > quadrupli

Re: Linear time baseconversion

2015-06-29 Thread Ian Kelly
On Mon, Jun 29, 2015 at 4:39 PM, wrote: > http://jt.node365.se/baseconversion8.html Back of the envelope mental calculation, that appears to be quadratic, not linear. Doubling the length of the input results in an approximate quadrupling of the time taken to produce the output. That noted, this

Linear time baseconversion

2015-06-29 Thread jonas . thornvall
http://jt.node365.se/baseconversion8.html -- https://mail.python.org/mailman/listinfo/python-list