<?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: How to avoid imprecise DECIMAL math in MySQL</title>
	<atom:link href="http://www.xaprb.com/blog/2006/03/08/decimal-math-in-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xaprb.com/blog/2006/03/08/decimal-math-in-mysql/</link>
	<description>Stay curious!</description>
	<lastBuildDate>Thu, 09 Feb 2012 09:56:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Xaprb</title>
		<link>http://www.xaprb.com/blog/2006/03/08/decimal-math-in-mysql/#comment-15124</link>
		<dc:creator>Xaprb</dc:creator>
		<pubDate>Tue, 23 Sep 2008 03:28:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=108#comment-15124</guid>
		<description>1 + 2

(Just testing to see if upgrading WP fixed the issues with plus)</description>
		<content:encoded><![CDATA[<p>1 + 2</p>
<p>(Just testing to see if upgrading WP fixed the issues with plus)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: newman</title>
		<link>http://www.xaprb.com/blog/2006/03/08/decimal-math-in-mysql/#comment-15118</link>
		<dc:creator>newman</dc:creator>
		<pubDate>Sat, 20 Sep 2008 03:57:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=108#comment-15118</guid>
		<description>note: topay PLUS dues

looks like the blog dont accept plus ^^.</description>
		<content:encoded><![CDATA[<p>note: topay PLUS dues</p>
<p>looks like the blog dont accept plus ^^.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: newman</title>
		<link>http://www.xaprb.com/blog/2006/03/08/decimal-math-in-mysql/#comment-15117</link>
		<dc:creator>newman</dc:creator>
		<pubDate>Sat, 20 Sep 2008 03:56:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=108#comment-15117</guid>
		<description>Thank you very much, i thought i would be the only one on this world wide web with that problem. This is a very strange bug, which took me at least 3 days. 

The problem wasn&#039;t the solving, i just couldn&#039;t believe that such a big mistake would be a system bug from mysql. The first time i&#039;ve found it with that statement:

SELECT * FROM table WHERE ( topay   dues ) &gt; paid 

I got a result, although everything was paid. After checking this with:

SELECT ( ( topay   dues ) - paid ) as result FROM table WHERE ( topay   dues ) &gt; paid 

it gave me : 0.00

which confused me more, well the end of the story, how i found a acceptable solution:

SELECT * FROM table WHERE ( ( topay   dues ) - paid ) &gt; 0.0001</description>
		<content:encoded><![CDATA[<p>Thank you very much, i thought i would be the only one on this world wide web with that problem. This is a very strange bug, which took me at least 3 days. </p>
<p>The problem wasn&#8217;t the solving, i just couldn&#8217;t believe that such a big mistake would be a system bug from mysql. The first time i&#8217;ve found it with that statement:</p>
<p>SELECT * FROM table WHERE ( topay   dues ) &gt; paid </p>
<p>I got a result, although everything was paid. After checking this with:</p>
<p>SELECT ( ( topay   dues ) &#8211; paid ) as result FROM table WHERE ( topay   dues ) &gt; paid </p>
<p>it gave me : 0.00</p>
<p>which confused me more, well the end of the story, how i found a acceptable solution:</p>
<p>SELECT * FROM table WHERE ( ( topay   dues ) &#8211; paid ) &gt; 0.0001</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.xaprb.com/blog/2006/03/08/decimal-math-in-mysql/#comment-10150</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Fri, 01 Jun 2007 06:26:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.xaprb.com/blog/?p=108#comment-10150</guid>
		<description>Thanks for all that info, it was good to find out why the problem is happening rather than just that it cant work...
I seem to have worked out the issue I was having with float types with the following statement - hope it helps anyone else. Cheers:

SELECT ID, Round(Sum(Total),2) As calcTotal FROM table 
GROUP BY ID 
HAVING Round(Sum(Total),2) &gt; 0
ORDER by calcTotal DESC</description>
		<content:encoded><![CDATA[<p>Thanks for all that info, it was good to find out why the problem is happening rather than just that it cant work&#8230;<br />
I seem to have worked out the issue I was having with float types with the following statement &#8211; hope it helps anyone else. Cheers:</p>
<p>SELECT ID, Round(Sum(Total),2) As calcTotal FROM table<br />
GROUP BY ID<br />
HAVING Round(Sum(Total),2) &gt; 0<br />
ORDER by calcTotal DESC</p>
]]></content:encoded>
	</item>
</channel>
</rss>

