<?xml version="1.0" encoding="iso-8859-1"?><rss version="2.0">
<channel><title><![CDATA[ActionScript.org Flash, Flex and ActionScript Resources - Comments for article: Maths Functions including Random]]></title><link>http://www.actionscript.org/resources</link><description /><language>en-us</language><copyright><![CDATA[http://www.actionscript.org/resources]]></copyright><generator>N/A</generator><webMaster>general.redirect@gmail.com</webMaster><lastBuildDate>Sat, 21 Nov 2009 20:13:40 CST</lastBuildDate><ttl>20</ttl><item><title><![CDATA[Comment #1]]></title><link>http://www.actionscript.org/resources/articles/90/1/Maths-Functions-including-Random/Page1.html#Comment12176</link><description><![CDATA[This method is great most of the time, though I just thought I'd mention that it doesn't provide even distribution of your random numbers - you're only half as likely to get your boundary numbers than any other number in the middle.

To get zero for instance you need
0 < x < 0.5 (a range of 0.5)

Whereas to get a one it's
0.5 < x < 1.5 (a range of 1.0)

Better to use Math.round(Math.random() * 11 - 0.5) if you need an even distribution.<br/><br/>
(Comment posted by Peter Gibson at 9:39 pm, Mon 27th Oct 2008)]]></description><author>no@spam.com (Peter Gibson)</author><pubDate><![CDATA[Mon, 27 Oct 2008 21:39:06 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/90/1/Maths-Functions-including-Random/Page1.html#Comment12176</guid></item><item><title><![CDATA[Comment #2]]></title><link>http://www.actionscript.org/resources/articles/90/1/Maths-Functions-including-Random/Page1.html#Comment12276</link><description><![CDATA[thanks a lot, it's easier to understand that the online help of macromedia ... ;o)<br/><br/>
(Comment posted by roqui at 12:50 pm, Sat 15th Nov 2008)]]></description><author>no@spam.com (roqui)</author><pubDate><![CDATA[Sat, 15 Nov 2008 12:50:38 CST]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/90/1/Maths-Functions-including-Random/Page1.html#Comment12276</guid></item><item><title><![CDATA[Comment #3]]></title><link>http://www.actionscript.org/resources/articles/90/1/Maths-Functions-including-Random/Page1.html#Comment12526</link><description><![CDATA[YOU GUYS ROCK!!! I was stuck until I found you guys. I rarely ever leave comments but you guys are worth it.<br/><br/>
(Comment posted by CompScienceAP at 6:50 pm, Mon 19th Jan 2009)]]></description><author>no@spam.com (CompScienceAP)</author><pubDate><![CDATA[Mon, 19 Jan 2009 18:50:06 CST]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/90/1/Maths-Functions-including-Random/Page1.html#Comment12526</guid></item><item><title><![CDATA[Comment #4]]></title><link>http://www.actionscript.org/resources/articles/90/1/Maths-Functions-including-Random/Page1.html#Comment12885</link><description><![CDATA[As per first comment you most definitely shouldn’t use the math.round as shown in the article your boundaries will occur half as much as the rest of the numbers.

Alternatively use Math.floor(Math.random()*11) for number between 0 and 10.<br/><br/>
(Comment posted by Bob Brown at 12:36 am, Thu 16th Apr 2009)]]></description><author>no@spam.com (Bob Brown)</author><pubDate><![CDATA[Thu, 16 Apr 2009 00:36:26 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/90/1/Maths-Functions-including-Random/Page1.html#Comment12885</guid></item><item><title><![CDATA[Comment #5]]></title><link>http://www.actionscript.org/resources/articles/90/1/Maths-Functions-including-Random/Page1.html#Comment12949</link><description><![CDATA[If you want positive numbers only, use Math.abs(Math.round (Math.random ()*200)-100);<br/><br/>
(Comment posted by Kristofer Carlo Serrano(creator of UpJump) at 6:11 pm, Thu 30th Apr 2009)]]></description><author>no@spam.com (Kristofer Carlo Serrano(creator of UpJump))</author><pubDate><![CDATA[Thu, 30 Apr 2009 18:11:05 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/90/1/Maths-Functions-including-Random/Page1.html#Comment12949</guid></item><item><title><![CDATA[Comment #6]]></title><link>http://www.actionscript.org/resources/articles/90/1/Maths-Functions-including-Random/Page1.html#Comment13315</link><description><![CDATA[how to make fix random number like VB.<br/><br/>
(Comment posted by Jason at 7:04 pm, Wed 5th Aug 2009)]]></description><author>no@spam.com (Jason)</author><pubDate><![CDATA[Wed, 05 Aug 2009 19:04:08 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/90/1/Maths-Functions-including-Random/Page1.html#Comment13315</guid></item></channel></rss>