<?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: Ruby thinks (19.99 * 100).to_i = 1998</title>
	<atom:link href="http://www.mokisystems.com/blog/ruby-thinks-1999-100to_i-1998/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mokisystems.com/blog/ruby-thinks-1999-100to_i-1998/</link>
	<description>Addressing such topics as: web programming, design, ruby on rails, cake php, postgresql, linux, seo</description>
	<lastBuildDate>Sat, 12 Nov 2011 05:39:30 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Wes Bangerter</title>
		<link>http://www.mokisystems.com/blog/ruby-thinks-1999-100to_i-1998/comment-page-1/#comment-493</link>
		<dc:creator>Wes Bangerter</dc:creator>
		<pubDate>Tue, 19 May 2009 20:47:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.mokisystems.com/blog/?p=60#comment-493</guid>
		<description>Just to verify what Marnen wrote, using a BigDecimal works with the example Daniel posted.

&gt;&gt; require &#039;bigdecimal&#039;
&gt;&gt; (BigDecimal.new(&#039;19.99&#039;) * 100).to_i
=&gt; 1999</description>
		<content:encoded><![CDATA[<p>Just to verify what Marnen wrote, using a BigDecimal works with the example Daniel posted.</p>
<p>&gt;&gt; require &#8216;bigdecimal&#8217;<br />
&gt;&gt; (BigDecimal.new(&#8217;19.99&#8242;) * 100).to_i<br />
=&gt; 1999</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marnen Laibow-Koser</title>
		<link>http://www.mokisystems.com/blog/ruby-thinks-1999-100to_i-1998/comment-page-1/#comment-491</link>
		<dc:creator>Marnen Laibow-Koser</dc:creator>
		<pubDate>Sun, 17 May 2009 03:28:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.mokisystems.com/blog/?p=60#comment-491</guid>
		<description>Wes: I&#039;m not surprised that this is an IEEE float issue. 

Leo: Wrong conclusion. The right conclusion: don&#039;t use *IEEE floats* to do math. Ruby has a BigDecimal library that completely gets around this problem by not using IEEE floats. Use it for math.</description>
		<content:encoded><![CDATA[<p>Wes: I&#8217;m not surprised that this is an IEEE float issue. </p>
<p>Leo: Wrong conclusion. The right conclusion: don&#8217;t use *IEEE floats* to do math. Ruby has a BigDecimal library that completely gets around this problem by not using IEEE floats. Use it for math.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wes Bangerter</title>
		<link>http://www.mokisystems.com/blog/ruby-thinks-1999-100to_i-1998/comment-page-1/#comment-478</link>
		<dc:creator>Wes Bangerter</dc:creator>
		<pubDate>Wed, 15 Apr 2009 23:27:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.mokisystems.com/blog/?p=60#comment-478</guid>
		<description>&quot;This behavior is not specific to Ruby. The reason Ruby behaves like this is that it adheres 
to the IEEE standard for floating point numbers, which is common to most programming languages.&quot;
From http://www.ruby-forum.com/topic/178503

You can read more about it at:
http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems

Or a lot more about it at:
http://docs.sun.com/source/806-3568/ncg_goldberg.html</description>
		<content:encoded><![CDATA[<p>&#8220;This behavior is not specific to Ruby. The reason Ruby behaves like this is that it adheres<br />
to the IEEE standard for floating point numbers, which is common to most programming languages.&#8221;<br />
From <a href="http://www.ruby-forum.com/topic/178503" rel="nofollow">http://www.ruby-forum.com/topic/178503</a></p>
<p>You can read more about it at:<br />
<a href="http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems" rel="nofollow">http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems</a></p>
<p>Or a lot more about it at:<br />
<a href="http://docs.sun.com/source/806-3568/ncg_goldberg.html" rel="nofollow">http://docs.sun.com/source/806-3568/ncg_goldberg.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leo</title>
		<link>http://www.mokisystems.com/blog/ruby-thinks-1999-100to_i-1998/comment-page-1/#comment-475</link>
		<dc:creator>Leo</dc:creator>
		<pubDate>Mon, 06 Apr 2009 20:18:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.mokisystems.com/blog/?p=60#comment-475</guid>
		<description>That is crazy!  I am not going to use ruby to do math.</description>
		<content:encoded><![CDATA[<p>That is crazy!  I am not going to use ruby to do math.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

