<?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: Suspect Rounding In .Net</title>
	<atom:link href="http://www.gringod.com/2005/10/28/suspect-rounding-in-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gringod.com/2005/10/28/suspect-rounding-in-net/</link>
	<description>Randomised nonsense.</description>
	<lastBuildDate>Fri, 04 Nov 2011 08:49:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: plafond</title>
		<link>http://www.gringod.com/2005/10/28/suspect-rounding-in-net/comment-page-1/#comment-12008</link>
		<dc:creator>plafond</dc:creator>
		<pubDate>Fri, 16 Jun 2006 15:58:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.gringod.com/2005/10/28/suspect-rounding-in-net/#comment-12008</guid>
		<description>The problem with the Double value is that it is a binary representation (0&#039;s and 1&#039;s).

Binary representations cannot represent every possible decimal value. 

It&#039;s very important to understand that in the same way that you can&#039;t represent a third exactly in a (finite) decimal expansion, there are lots of numbers which look simple in decimal, but which have long or infinite expansions in a binary expansion. This means that (for instance) a binary floating point variable can&#039;t have the exact value of decimal 0.1.

See &quot;http://www.yoda.arachsys.com/csharp/floatingpoint.html&quot; for more info

If you need to guaranty precision use decimal. Microsoft documentation state &quot;The Decimal value type is appropriate for financial calculations requiring large numbers of significant integral and fractional digits and no round-off errors.&quot;</description>
		<content:encoded><![CDATA[<p>The problem with the Double value is that it is a binary representation (0&#8242;s and 1&#8242;s).</p>
<p>Binary representations cannot represent every possible decimal value. </p>
<p>It&#8217;s very important to understand that in the same way that you can&#8217;t represent a third exactly in a (finite) decimal expansion, there are lots of numbers which look simple in decimal, but which have long or infinite expansions in a binary expansion. This means that (for instance) a binary floating point variable can&#8217;t have the exact value of decimal 0.1.</p>
<p>See &#8220;http://www.yoda.arachsys.com/csharp/floatingpoint.html&#8221; for more info</p>
<p>If you need to guaranty precision use decimal. Microsoft documentation state &#8220;The Decimal value type is appropriate for financial calculations requiring large numbers of significant integral and fractional digits and no round-off errors.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GrinGod [dot] Com &#187; Blog Archive &#187; Double Imprecision In .Net</title>
		<link>http://www.gringod.com/2005/10/28/suspect-rounding-in-net/comment-page-1/#comment-10107</link>
		<dc:creator>GrinGod [dot] Com &#187; Blog Archive &#187; Double Imprecision In .Net</dc:creator>
		<pubDate>Wed, 01 Feb 2006 18:26:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.gringod.com/2005/10/28/suspect-rounding-in-net/#comment-10107</guid>
		<description>[...] 7:26 pm  I&#8217;ve spouted on about this previously on my blog but I thought it was about time I posted some code that demonstrates some of the problems we&#8217;re up against. The problem seems to be that under certain circumstances the .Net Double data type loose its precision and gives you a number that you weren&#8217;t expecting. The chances are that the error will be out by 0.00000000000001, but that might be enough to cause an error. [...]</description>
		<content:encoded><![CDATA[<p>[...] 7:26 pm  I&#8217;ve spouted on about this previously on my blog but I thought it was about time I posted some code that demonstrates some of the problems we&#8217;re up against. The problem seems to be that under certain circumstances the .Net Double data type loose its precision and gives you a number that you weren&#8217;t expecting. The chances are that the error will be out by 0.00000000000001, but that might be enough to cause an error. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

