<?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: Converting a Number to 4 bytes and vice versa</title>
	<atom:link href="http://blog.joa-ebert.com/2007/10/01/converting-a-number-to-4-bytes-and-vice-versa/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.joa-ebert.com/2007/10/01/converting-a-number-to-4-bytes-and-vice-versa/</link>
	<description>Actionscript3, Flash, Scala, Java, C#, C++, Algorithms &#38; Imageprocessing</description>
	<lastBuildDate>Thu, 29 Jul 2010 22:42:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Danny Miller</title>
		<link>http://blog.joa-ebert.com/2007/10/01/converting-a-number-to-4-bytes-and-vice-versa/comment-page-1/#comment-99264</link>
		<dc:creator>Danny Miller</dc:creator>
		<pubDate>Wed, 07 May 2008 16:49:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.je2050.de/2007/10/01/converting-a-number-to-4-bytes-and-vice-versa/#comment-99264</guid>
		<description>Great post. I was searching Google as I was trying this method when I read about it somewhere else. Glad to see that someone has tried it out and tested it against flash&#039;s built in sqrt... Maybe Adobe should adopt this method when they upgrade.</description>
		<content:encoded><![CDATA[<p>Great post. I was searching Google as I was trying this method when I read about it somewhere else. Glad to see that someone has tried it out and tested it against flash&#8217;s built in sqrt&#8230; Maybe Adobe should adopt this method when they upgrade.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: michael</title>
		<link>http://blog.joa-ebert.com/2007/10/01/converting-a-number-to-4-bytes-and-vice-versa/comment-page-1/#comment-55392</link>
		<dc:creator>michael</dc:creator>
		<pubDate>Sun, 14 Oct 2007 17:30:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.je2050.de/2007/10/01/converting-a-number-to-4-bytes-and-vice-versa/#comment-55392</guid>
		<description>i have also tried to implement the inverse square root func by using a bytearray to map a float to an integer:

&lt;code&gt;
public function invSqrt(x:Number):Number
{
    var xhalf:Number = .5 * x;
    
    var t:ByteArray = new ByteArray();
    t.writeFloat(x);
    t.position = 0;
    
    var i:int = t.readInt();
    i = 0x5f3759df - ( i &gt;&gt; 1);
    
    t.position = 0;
    t.writeInt(i);
    t.position = 0;
    x = t.readFloat();
    
    x = x * (1.5 - xhalf * x * x);
    return x;
}
&lt;/code&gt;

works perfectly, but of course it&#039;s much slower than a simple Math.sqrt() call.</description>
		<content:encoded><![CDATA[<p>i have also tried to implement the inverse square root func by using a bytearray to map a float to an integer:</p>
<p><code><br />
public function invSqrt(x:Number):Number<br />
{<br />
    var xhalf:Number = .5 * x;</p>
<p>    var t:ByteArray = new ByteArray();<br />
    t.writeFloat(x);<br />
    t.position = 0;</p>
<p>    var i:int = t.readInt();<br />
    i = 0x5f3759df - ( i &gt;&gt; 1);</p>
<p>    t.position = 0;<br />
    t.writeInt(i);<br />
    t.position = 0;<br />
    x = t.readFloat();</p>
<p>    x = x * (1.5 - xhalf * x * x);<br />
    return x;<br />
}<br />
</code></p>
<p>works perfectly, but of course it&#8217;s much slower than a simple Math.sqrt() call.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joa</title>
		<link>http://blog.joa-ebert.com/2007/10/01/converting-a-number-to-4-bytes-and-vice-versa/comment-page-1/#comment-55352</link>
		<dc:creator>joa</dc:creator>
		<pubDate>Tue, 02 Oct 2007 10:00:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.je2050.de/2007/10/01/converting-a-number-to-4-bytes-and-vice-versa/#comment-55352</guid>
		<description>I did not. Thank you Mario :)</description>
		<content:encoded><![CDATA[<p>I did not. Thank you Mario :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mario Klingemann</title>
		<link>http://blog.joa-ebert.com/2007/10/01/converting-a-number-to-4-bytes-and-vice-versa/comment-page-1/#comment-55339</link>
		<dc:creator>Mario Klingemann</dc:creator>
		<pubDate>Mon, 01 Oct 2007 19:01:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.je2050.de/2007/10/01/converting-a-number-to-4-bytes-and-vice-versa/#comment-55339</guid>
		<description>When you write &quot;can not shift because flash doesnt like it...&quot; - did you already try the unsigned bitwise shift ( &gt;&gt;&gt; )?</description>
		<content:encoded><![CDATA[<p>When you write &#8220;can not shift because flash doesnt like it&#8230;&#8221; &#8211; did you already try the unsigned bitwise shift ( &gt;&gt;&gt; )?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
