<?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: Floating-point errors got you down?</title>
	<atom:link href="http://joshblog.net/2007/01/30/flash-floating-point-number-errors/feed/" rel="self" type="application/rss+xml" />
	<link>http://joshblog.net/2007/01/30/flash-floating-point-number-errors/</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Tue, 31 Jan 2012 13:51: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: Josh Tynjala</title>
		<link>http://joshblog.net/2007/01/30/flash-floating-point-number-errors/#comment-30366</link>
		<dc:creator>Josh Tynjala</dc:creator>
		<pubDate>Thu, 26 Jan 2012 02:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/archives/119/flash-floating-point-number-errors/#comment-30366</guid>
		<description>Edit: I see you fixed your issue. Leaving this explanation here in case it may help someone else.

I&#039;m not sure if you have collision detection involved in your calculations, Felps, but that kind of reminds me of a common issue. Sometimes an object can be moving so fast that it never actually can be detected in a direct collision. You need to also check to see if the object hasn&#039;t overshot a barrier without actually touching the barrier. Even if it&#039;s not collision detection, if your vector based approach (I&#039;m not sure what that means, exactly) is something like a lookup table, I could see it losing accuracy as you add in increased power values.

You may be right, though. I&#039;m not as familiar with your code as you are. However, for visual positioning, it&#039;s rare that floating point errors will throw an object extremely far away from where it should be. Usually, it&#039;s much less than a pixel for each error, so you would need a great deal of errors accumulating to see a problem.</description>
		<content:encoded><![CDATA[<p>Edit: I see you fixed your issue. Leaving this explanation here in case it may help someone else.</p>
<p>I&#8217;m not sure if you have collision detection involved in your calculations, Felps, but that kind of reminds me of a common issue. Sometimes an object can be moving so fast that it never actually can be detected in a direct collision. You need to also check to see if the object hasn&#8217;t overshot a barrier without actually touching the barrier. Even if it&#8217;s not collision detection, if your vector based approach (I&#8217;m not sure what that means, exactly) is something like a lookup table, I could see it losing accuracy as you add in increased power values.</p>
<p>You may be right, though. I&#8217;m not as familiar with your code as you are. However, for visual positioning, it&#8217;s rare that floating point errors will throw an object extremely far away from where it should be. Usually, it&#8217;s much less than a pixel for each error, so you would need a great deal of errors accumulating to see a problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felps</title>
		<link>http://joshblog.net/2007/01/30/flash-floating-point-number-errors/#comment-30365</link>
		<dc:creator>Felps</dc:creator>
		<pubDate>Thu, 26 Jan 2012 02:12:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/archives/119/flash-floating-point-number-errors/#comment-30365</guid>
		<description>Whoops, false alarm... It&#039;s my hard-limit on the speed objects can travel.</description>
		<content:encoded><![CDATA[<p>Whoops, false alarm&#8230; It&#8217;s my hard-limit on the speed objects can travel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felps</title>
		<link>http://joshblog.net/2007/01/30/flash-floating-point-number-errors/#comment-30364</link>
		<dc:creator>Felps</dc:creator>
		<pubDate>Thu, 26 Jan 2012 02:04:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/archives/119/flash-floating-point-number-errors/#comment-30364</guid>
		<description>I&#039;m working on a game in flash, in it I&#039;m having the player fire objects towards objects with gravity as if they were all in outer-space, long story short, I believe my nice, efficient vector-based (as opposed to trig-based) calculations for finding the angle of the trajectory proposed by the player (via mouse click, power designated by length of time the mouse was held) are running into this issue.

At low speeds the trajectory is spot on, hits the mouse cursor every time, but as the speed increases, it flies off course!  I might just have to use somewhat less efficient trig functions for it.</description>
		<content:encoded><![CDATA[<p>I&#8217;m working on a game in flash, in it I&#8217;m having the player fire objects towards objects with gravity as if they were all in outer-space, long story short, I believe my nice, efficient vector-based (as opposed to trig-based) calculations for finding the angle of the trajectory proposed by the player (via mouse click, power designated by length of time the mouse was held) are running into this issue.</p>
<p>At low speeds the trajectory is spot on, hits the mouse cursor every time, but as the speed increases, it flies off course!  I might just have to use somewhat less efficient trig functions for it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: { _brendynZachary : FlashDeveloperBlog }</title>
		<link>http://joshblog.net/2007/01/30/flash-floating-point-number-errors/#comment-398</link>
		<dc:creator>{ _brendynZachary : FlashDeveloperBlog }</dc:creator>
		<pubDate>Mon, 20 Sep 2010 16:48:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/archives/119/flash-floating-point-number-errors/#comment-398</guid>
		<description>[...] found a method online that corrects this by comparing a few numbers, and estimating. Seems to do the trick in my case.    [...]</description>
		<content:encoded><![CDATA[<p>[...] found a method online that corrects this by comparing a few numbers, and estimating. Seems to do the trick in my case.    [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Konstantin</title>
		<link>http://joshblog.net/2007/01/30/flash-floating-point-number-errors/#comment-397</link>
		<dc:creator>Konstantin</dc:creator>
		<pubDate>Tue, 07 Sep 2010 05:30:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/archives/119/flash-floating-point-number-errors/#comment-397</guid>
		<description>This is a great work around for the problem - for calculating taxes, it seems to do the job.</description>
		<content:encoded><![CDATA[<p>This is a great work around for the problem &#8211; for calculating taxes, it seems to do the job.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ganesh</title>
		<link>http://joshblog.net/2007/01/30/flash-floating-point-number-errors/#comment-396</link>
		<dc:creator>Ganesh</dc:creator>
		<pubDate>Thu, 28 Jan 2010 10:11:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/archives/119/flash-floating-point-number-errors/#comment-396</guid>
		<description>Thans man that really worked like magic! dont know what these flex guys doing</description>
		<content:encoded><![CDATA[<p>Thans man that really worked like magic! dont know what these flex guys doing</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dealing with floating point numbers in AS3 &#171; Ramblings</title>
		<link>http://joshblog.net/2007/01/30/flash-floating-point-number-errors/#comment-395</link>
		<dc:creator>Dealing with floating point numbers in AS3 &#171; Ramblings</dc:creator>
		<pubDate>Mon, 30 Nov 2009 08:08:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/archives/119/flash-floating-point-number-errors/#comment-395</guid>
		<description>[...] Floating-point errors got you down? &#8211; Josh Talks Flash Many developers will never encounter issues when floating-point math fails to return the correct result. Every once in a while, when you&#8217;re expecting to see a number like 10.1 in your trace panel, you might actually see 10.1000000001. This isn&#8217;t a specific issue with Flash either. By it&#8217;s very nature, any sort of calculation with floating-point numbers can result in tiny, nearly insignificant errors anywhere in modern computing. [...]</description>
		<content:encoded><![CDATA[<p>[...] Floating-point errors got you down? &#8211; Josh Talks Flash Many developers will never encounter issues when floating-point math fails to return the correct result. Every once in a while, when you&#8217;re expecting to see a number like 10.1 in your trace panel, you might actually see 10.1000000001. This isn&#8217;t a specific issue with Flash either. By it&#8217;s very nature, any sort of calculation with floating-point numbers can result in tiny, nearly insignificant errors anywhere in modern computing. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Overcoming rounding errors &#171; e2easy AIR applications</title>
		<link>http://joshblog.net/2007/01/30/flash-floating-point-number-errors/#comment-394</link>
		<dc:creator>Overcoming rounding errors &#171; e2easy AIR applications</dc:creator>
		<pubDate>Thu, 25 Sep 2008 20:43:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/archives/119/flash-floating-point-number-errors/#comment-394</guid>
		<description>[...] that would have involved many program operations to simulate each BCD calculation. Â Then this blog by Josh Tynjala gave me another idea. Â (Ok, probably not a new idea - but it was a revelation to [...]</description>
		<content:encoded><![CDATA[<p>[...] that would have involved many program operations to simulate each BCD calculation. Â Then this blog by Josh Tynjala gave me another idea. Â (Ok, probably not a new idea &#8211; but it was a revelation to [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flash/Actionscript: Innaccurate math results : Ryan Bosinger</title>
		<link>http://joshblog.net/2007/01/30/flash-floating-point-number-errors/#comment-393</link>
		<dc:creator>Flash/Actionscript: Innaccurate math results : Ryan Bosinger</dc:creator>
		<pubDate>Mon, 21 Jul 2008 18:10:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/archives/119/flash-floating-point-number-errors/#comment-393</guid>
		<description>[...] I originally found this information/code on a post called Floating-point errors got you down? [...]</description>
		<content:encoded><![CDATA[<p>[...] I originally found this information/code on a post called Floating-point errors got you down? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://joshblog.net/2007/01/30/flash-floating-point-number-errors/#comment-392</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Thu, 10 Jul 2008 17:45:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.zeuslabs.us/archives/119/flash-floating-point-number-errors/#comment-392</guid>
		<description>Josh, thanks a lot man!  I actually did run into this while trying to do some AS based audio fades.  Your &quot;correctFloatingPointError&quot; function smoothed that out nicely.</description>
		<content:encoded><![CDATA[<p>Josh, thanks a lot man!  I actually did run into this while trying to do some AS based audio fades.  Your &#8220;correctFloatingPointError&#8221; function smoothed that out nicely.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

