<?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: Problem with comparison of float or double column in MySQL</title> <atom:link href="http://viralpatel.net/blogs/2008/12/problem-with-comparison-of-float-or-double-column-in-mysql.html/feed" rel="self" type="application/rss+xml" /><link>http://viralpatel.net/blogs/2008/12/problem-with-comparison-of-float-or-double-column-in-mysql.html</link> <description>Tutorials, Java, J2EE, Struts, AJAX, JavaScript, CSS, Web 2.0, MySQL, Articles</description> <lastBuildDate>Thu, 09 Feb 2012 07:08:35 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Pankaj Kumar</title><link>http://viralpatel.net/blogs/2008/12/problem-with-comparison-of-float-or-double-column-in-mysql.html/comment-page-1#comment-11936</link> <dc:creator>Pankaj Kumar</dc:creator> <pubDate>Fri, 15 Jan 2010 11:35:37 +0000</pubDate> <guid isPermaLink="false">http://viralpatel.net/blogs/?p=343#comment-11936</guid> <description>Thanks dear,I had also use the float type but camparision with this filed was not working. then I convert that filed with decimal,now is working.</description> <content:encoded><![CDATA[<p>Thanks dear,</p><p>I had also use the float type but camparision with this filed was not working. then I convert that filed with decimal,now is working.</p> ]]></content:encoded> </item> <item><title>By: N</title><link>http://viralpatel.net/blogs/2008/12/problem-with-comparison-of-float-or-double-column-in-mysql.html/comment-page-1#comment-11518</link> <dc:creator>N</dc:creator> <pubDate>Mon, 19 Oct 2009 09:51:28 +0000</pubDate> <guid isPermaLink="false">http://viralpatel.net/blogs/?p=343#comment-11518</guid> <description>http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.htmlThe correct way to do floating-point number comparison is to first decide on an acceptable tolerance for differences between the numbers and then do the comparison against the tolerance value. For example, if we agree that floating-point numbers should be regarded the same if they are same within a precision of one in ten thousand (0.0001), the comparison should be written to find differences larger than the tolerance value:Conversely, to get rows where the numbers are the same, the test should find differences within the tolerance value: mysql&gt; SELECT i, SUM(d1) AS a, SUM(d2) AS b FROM t1 -&gt; GROUP BY i HAVING ABS(a - b) &lt;= 0.0001;</description> <content:encoded><![CDATA[<p><a href="http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html</a></p><p>The correct way to do floating-point number comparison is to first decide on an acceptable tolerance for differences between the numbers and then do the comparison against the tolerance value. For example, if we agree that floating-point numbers should be regarded the same if they are same within a precision of one in ten thousand (0.0001), the comparison should be written to find differences larger than the tolerance value:</p><p>Conversely, to get rows where the numbers are the same, the test should find differences within the tolerance value:<br /> mysql&gt; SELECT i, SUM(d1) AS a, SUM(d2) AS b FROM t1<br /> -&gt; GROUP BY i HAVING ABS(a &#8211; b) &lt;= 0.0001;</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: viralpatel.net @ 2012-02-09 14:12:34 -->
