<?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>Compiled Thoughts by John Ciacia &#187; factorial</title>
	<atom:link href="http://www.johnciacia.com/tag/factorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johnciacia.com</link>
	<description>Science, Technology, and Beyond</description>
	<lastBuildDate>Fri, 06 Jan 2012 15:46:22 +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>Euler&#8217;s Constant</title>
		<link>http://www.johnciacia.com/2009/05/21/eulers-constant/</link>
		<comments>http://www.johnciacia.com/2009/05/21/eulers-constant/#comments</comments>
		<pubDate>Thu, 21 May 2009 05:33:44 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[e]]></category>
		<category><![CDATA[euler]]></category>
		<category><![CDATA[eulers constant]]></category>
		<category><![CDATA[factorial]]></category>
		<category><![CDATA[recursion]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=139</guid>
		<description><![CDATA[Calculate Euler&#8217;s constant. [code lang="cpp"]#include /** * This code will calculate e * as the sum of the infinite series * 1/1! + 1/2! + 1/3! + ... + 1/n! * g++ e.c * ./a.out */ int factorial(unsigned int i); int main() { double e = 1.0; for (int n = 10; n > 0; [...]]]></description>
			<content:encoded><![CDATA[<p>Calculate Euler&#8217;s constant.<br />
[code lang="cpp"]#include <stdio.h><br />
/**<br />
 * This code will calculate e<br />
 * as the sum of the infinite series<br />
 * 1/1! + 1/2! + 1/3! + ... + 1/n!<br />
 * g++ e.c<br />
 * ./a.out<br />
 */<br />
int factorial(unsigned int i);</p>
<p>int main() {<br />
    double e = 1.0;<br />
    for (int n = 10; n > 0; n--)<br />
        e += 1.0/factorial(n);<br />
    printf ("e = %lgn", e);<br />
    return 0;<br />
}</p>
<p>int factorial(unsigned int i) {<br />
    if(i == 0 || i == 1)<br />
        return 1.0;<br />
    return i * factorial(i-1);<br />
}[/code]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2009/05/21/eulers-constant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.johnciacia.com @ 2012-02-05 10:58:35 -->
