<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Algorithms in Python: Base Expansion</title>
	<atom:link href="http://blog.madpython.com/2010/07/10/algorithms-in-python-base-expansion/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.madpython.com/2010/07/10/algorithms-in-python-base-expansion/</link>
	<description>Watch out.. he's angry</description>
	<lastBuildDate>Wed, 14 Dec 2011 02:03:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Alexander Wallar</title>
		<link>http://blog.madpython.com/2010/07/10/algorithms-in-python-base-expansion/comment-page-1/#comment-170</link>
		<dc:creator>Alexander Wallar</dc:creator>
		<pubDate>Thu, 03 Nov 2011 01:48:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.madpython.com/?p=111#comment-170</guid>
		<description>from math import *
def baseExpansion(n,c,b):
....j = 0
....base10 = sum([pow(c,len(n)-k-1)*n[k] for k in range(0,len(n))])
....while floor(base10/pow(b,j)) != 0: j = j+1
.....return [floor(base10/pow(b,j-p)) % b for p in range(1,j+1)]

This algorithm although it might be a bit longer, runs without bounds on integer bases. The input is a list and so is the output as to accommodate for larger bases.</description>
		<content:encoded><![CDATA[<p>from math import *<br />
def baseExpansion(n,c,b):<br />
&#8230;.j = 0<br />
&#8230;.base10 = sum([pow(c,len(n)-k-1)*n[k] for k in range(0,len(n))])<br />
&#8230;.while floor(base10/pow(b,j)) != 0: j = j+1<br />
&#8230;..return [floor(base10/pow(b,j-p)) % b for p in range(1,j+1)]</p>
<p>This algorithm although it might be a bit longer, runs without bounds on integer bases. The input is a list and so is the output as to accommodate for larger bases.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

