<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Laughing Meme &#187; math</title>
	<atom:link href="http://laughingmeme.org/tag/math/feed/" rel="self" type="application/rss+xml" />
	<link>http://laughingmeme.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 02 Apr 2012 20:12:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>bceval: arbitrary precision math for PHP without extensions</title>
		<link>http://laughingmeme.org/2008/03/25/bceval-arbitrary-precision-math-for-php-without-extensions/</link>
		<comments>http://laughingmeme.org/2008/03/25/bceval-arbitrary-precision-math-for-php-without-extensions/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 20:50:38 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[big numbers]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://laughingmeme.org/2008/03/25/bceval-arbitrary-precision-math-for-php-without-extensions/</guid>
		<description><![CDATA[I needed arbitrary precision math in PHP, and wasn&#8217;t willing to rebuild PHP to add the bcmath extensions. All hail backticks. function bceval($expr) { return trim(`echo "$expr" &#124; bc`); } Used like so $end = bceval("$start + $batchsize - 1"); Wet cat territory.]]></description>
			<content:encoded><![CDATA[<p>I needed arbitrary precision math in PHP, and wasn&#8217;t willing to rebuild PHP to add the <a href="http://www.php.net/bc">bcmath</a> extensions.  All hail backticks.</p>

<pre><code>function bceval($expr) {
  return trim(`echo "$expr" | bc`);
}
</code></pre>

<p>Used like so</p>

<pre><code>$end = bceval("$start + $batchsize - 1");
</code></pre>

<p><a href="http://simonwillison.net/2003/Jun/24/philosophy/">Wet cat</a> territory.</p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2008/03/25/bceval-arbitrary-precision-math-for-php-without-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

