<?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: A Simple TBB Program: TBB Prime</title>
	<atom:link href="http://www.kerrywong.com/2008/06/22/a-simple-tbb-program-tbb-prime/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kerrywong.com/2008/06/22/a-simple-tbb-program-tbb-prime/</link>
	<description></description>
	<lastBuildDate>Fri, 12 Mar 2010 01:25:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: kwong</title>
		<link>http://www.kerrywong.com/2008/06/22/a-simple-tbb-program-tbb-prime/comment-page-1/#comment-12098</link>
		<dc:creator>kwong</dc:creator>
		<pubDate>Sat, 12 Jul 2008 23:58:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.kerrywong.com/2008/06/22/a-simple-tbb-program-tbb-prime/#comment-12098</guid>
		<description>The default blocked_range does not divide odd-number-only range correctly. Thus the operator() loop needs to be changed to 
&lt;code&gt;
        for (size_t i = r.begin(); i &lt; r.end(); i++)
        {
            test_prime(i);
        }
&lt;/code&gt;

and the main loop in test_prime needs to be changed to 

&lt;code&gt;
        for (int i = 2; i &lt;= sqrt((double) num); i+=1)
        {
            if (num % i == 0)
            {
                is_prime = false;
                break;
            }
        }
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>The default blocked_range does not divide odd-number-only range correctly. Thus the operator() loop needs to be changed to<br />
<code><br />
        for (size_t i = r.begin(); i < r.end(); i++)<br />
        {<br />
            test_prime(i);<br />
        }<br />
</code></p>
<p>and the main loop in test_prime needs to be changed to </p>
<p></code><code><br />
        for (int i = 2; i < = sqrt((double) num); i+=1)<br />
        {<br />
            if (num % i == 0)<br />
            {<br />
                is_prime = false;<br />
                break;<br />
            }<br />
        }<br />
</code></code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
