<?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: secondary school mathematics that was almost useful</title>
	<atom:link href="http://www.hackinghat.com/index.php/database/secondary-school-mathematics-that-was-almost-useful/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hackinghat.com/index.php/database/secondary-school-mathematics-that-was-almost-useful</link>
	<description></description>
	<lastBuildDate>Tue, 20 Jul 2010 09:51:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Steve Knight</title>
		<link>http://www.hackinghat.com/index.php/database/secondary-school-mathematics-that-was-almost-useful/comment-page-1#comment-1230</link>
		<dc:creator>Steve Knight</dc:creator>
		<pubDate>Thu, 18 Oct 2007 06:32:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.hackinghat.com/?p=3#comment-1230</guid>
		<description>Just thought I&#039;d add something to this.  I was just showing a colleague this particular trick in SQL Server 2005 when it didn&#039;t work.   I scratched my head and figured I was missing something.   He pointed out that for a fractional &#039;value&#039; you need to be careful of functions like POWER().   They return their results in the same precision as the first argument.   Thus:

&lt;pre&gt;&lt;code&gt;SELECT POWER(10, SUM(LOG10(value)))&lt;/code&gt;&lt;/pre&gt;

Will return a result with no decimal places!!  It should really be:

&lt;pre&gt;&lt;code&gt;SELECT POWER(CONVERT(NUMERIC(18,8), 10), SUM(LOG10(value)))&lt;/code&gt;&lt;/pre&gt;

Thanks!</description>
		<content:encoded><![CDATA[<p>Just thought I&#8217;d add something to this.  I was just showing a colleague this particular trick in SQL Server 2005 when it didn&#8217;t work.   I scratched my head and figured I was missing something.   He pointed out that for a fractional &#8216;value&#8217; you need to be careful of functions like POWER().   They return their results in the same precision as the first argument.   Thus:</p>
<pre><code>SELECT POWER(10, SUM(LOG10(value)))</code></pre>
<p>Will return a result with no decimal places!!  It should really be:</p>
<pre><code>SELECT POWER(CONVERT(NUMERIC(18,8), 10), SUM(LOG10(value)))</code></pre>
<p>Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
