<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ActionScript Scraps &#187; number</title>
	<atom:link href="http://blog.sitedaniel.com/tag/number/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sitedaniel.com</link>
	<description>Flash, Flex and AIR development</description>
	<lastBuildDate>Wed, 01 Sep 2010 21:15:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Restricting a number to a certain range</title>
		<link>http://blog.sitedaniel.com/2009/06/restricting-a-number-to-a-certain-range/</link>
		<comments>http://blog.sitedaniel.com/2009/06/restricting-a-number-to-a-certain-range/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 13:02:48 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[number]]></category>

		<guid isPermaLink="false">http://blog.sitedaniel.com/?p=326</guid>
		<description><![CDATA[Quite often I need to restrict a number to a range with a defined maximum and minimum value. Rather than using if else statements you can do this simply with Math.max and Math.min: &#160; var restricted_value:Number = Math.max&#40;MIN_VALUE, Math.min&#40;MAX_VALUE, value&#41;&#41;; &#160;]]></description>
			<content:encoded><![CDATA[<p>Quite often I need to restrict a number to a range with a defined maximum and minimum value. Rather than using if else statements you can do this simply with Math.max and Math.min:</p>
<pre class="actionscript">&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> restricted_value:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">max</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">MIN_VALUE</span>, <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">min</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">MAX_VALUE</span>, value<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.sitedaniel.com/2009/06/restricting-a-number-to-a-certain-range/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
