<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[Burn's Interactive  锐梵互动 - arduino双语手册]]></title>
<link>http://www.burncg.cn/burnblog/</link>
<description><![CDATA[中国 成都 Chengdu, China---会展、馆场、活动原创科技展项]]></description>
<language>zh-cn</language>
<copyright><![CDATA[Copyright 2005 PBlog3 v2.8]]></copyright>
<webMaster><![CDATA[24672468@sina.com(burn)]]></webMaster>
<generator>PBlog2 v2.4</generator> 
<image>
	<title>Burn&#39;s Interactive  锐梵互动</title>
	<url>http://www.burncg.cn/burnblog/images/logos.gif</url>
	<link>http://www.burncg.cn/burnblog/</link>
	<description>Burn&#39;s Interactive  锐梵互动</description>
</image>

			<item>
			<link>http://www.burncg.cn/burnblog/article.asp?id=73</link>
			<title><![CDATA[Unsigned Long]]></title>
			<author>24672468@sina.com(admin)</author>
			<category><![CDATA[arduino双语手册]]></category>
			<pubDate>Sat,05 Jan 2008 00:24:57 +0800</pubDate>
			<guid>http://www.burncg.cn/burnblog/default.asp?id=73</guid>
		<description><![CDATA[<h2>unsigned long</h2>
<h4>Description描述</h4>
<p>Unsigned long variables are extended size variables for number storage, and store 32 bits (4 bytes). Unlike standard longs unsigned longs won't store negative numbers, making their range from 0 to 4,294,967,295 (2^32 - 1). <br />Unsigned long variables是用于储存数值的变量的一种扩展方式，可以储存32 bits (4bytes)。Unsigned long特别之处在于不能储存负值，其储存的值的范围是0 到 4,294,967,295。</p>
<p class="vspace">&nbsp;</p>
<h4>Example范例</h4>
<pre>unsigned long time;
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.print(&quot;Time: &quot;);
time = millis();
//prints time since program started<br />  // 在程序开始后返回时间。
Serial.println(time);
// wait a second so as not to send massive amounts of data<br />  // 延迟1秒，以便发送大量的数据。
delay(1000);
}
</pre>
<h4>Syntax语法</h4>
<pre>    unsigned long var = val;
</pre>
<p class="vspace">&nbsp;</p>
<ul>
    <li>var - your long variable name 变量名 </li>
    <li>val - the value you assign to that variable 分配给变量的值 </li>
</ul>
<p class="vspace">&nbsp;</p>
<h4>See Also</h4>
<ul>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Byte.html">byte</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Int.html">int</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/UnsignedInt.html">unsigned int</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Long.html">long</a> </li>
</ul>]]></description>
		</item>
		
			<item>
			<link>http://www.burncg.cn/burnblog/article.asp?id=72</link>
			<title><![CDATA[Long]]></title>
			<author>24672468@sina.com(admin)</author>
			<category><![CDATA[arduino双语手册]]></category>
			<pubDate>Sat,05 Jan 2008 00:19:26 +0800</pubDate>
			<guid>http://www.burncg.cn/burnblog/default.asp?id=72</guid>
		<description><![CDATA[<h1>long</h1>
<h4>Description描述</h4>
<p>Long variables are extended size variables for number storage, and store 32 bits (4 bytes), from -2,147,483,648 to 2,147,483,647. <br />Long变量是更大范围的数值储存方式，可以储存32位（4字节），从-2,147,483,648 到 2,147,483,647之间的数值。</p>
<p class="vspace">&nbsp;</p>
<h4>Example范例</h4>
<pre>long time;
void setup(){
Serial.begin(9600);
}
void loop(){
Serial.print(&quot;Time: &quot;);
time = <a href="http://www.burncg.cn/burnblog/article.asp?id=71">millis()</a>;
//prints time since program started<br /> // 得到从程序开始正常运行的时间
Serial.println(time);
// wait a second so as not to send massive amounts of data<br /> // 延迟1秒，以便发送大量的数据。
delay(1000);
}
</pre>
<h4>Syntax语法</h4>
<pre>    long var = val;
</pre>
<p class="vspace">&nbsp;</p>
<ul>
    <li>var - your long variable name 你的长整数变量名 </li>
    <li>val - the value you assign to that variable 你指定给这个变量的值 </li>
</ul>
<p class="vspace">&nbsp;</p>
<h4>See Also</h4>
<ul>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Byte.html">byte</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Int.html">int</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/UnsignedInt.html">unsigned int</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/UnsignedLong.html">unsigned long</a> </li>
</ul>]]></description>
		</item>
		
			<item>
			<link>http://www.burncg.cn/burnblog/article.asp?id=71</link>
			<title><![CDATA[Millis]]></title>
			<author>24672468@sina.com(admin)</author>
			<category><![CDATA[arduino双语手册]]></category>
			<pubDate>Sat,05 Jan 2008 00:15:13 +0800</pubDate>
			<guid>http://www.burncg.cn/burnblog/default.asp?id=71</guid>
		<description><![CDATA[<h2>unsigned long millis()</h2>
<h4>Description</h4>
<p>Returns the number of milliseconds since the Arduino board began running the current program.<br />返回Arduino卡开始正常运行程序后的毫秒数。</p>
<p class="vspace">&nbsp;</p>
<h4>Parameters参数</h4>
<p>None 无 </p>
<p class="vspace">&nbsp;</p>
<h4>Returns返回</h4>
<p>The number of milliseconds since the current program started running, as an unsigned long. This number will overflow (go back to zero), after approximately 9 hours. <br />返回自从当前程序开始运行后的毫秒数，这是一个无符号的长整数。如果这个值超过了大约9小时，会产生数据溢出（返回到0）。</p>
<p class="vspace">&nbsp;</p>
<h4>Examples范例</h4>
<pre>long time;
void setup(){
Serial.begin(9600);
}
void loop(){
Serial.print(&quot;Time: &quot;);
time = millis();
//prints time since program started<br /> // 得到从程序开始正常运行的时间
Serial.println(time);
// wait a second so as not to send massive amounts of data<br /> // 延迟1秒，以便发送大量的数据。
delay(1000);
}
/* Frequency Test<br />   频率测试
*  Paul Badger 2007
*  Program to empirically determine the time delay to generate the
*  proper frequency for a an  Infrared (IR) Remote Control Receiver module
*  These modules typically require 36 - 52 khz communication frequency
*  depending on specific device.<br />   程序为一个红外（IR）遥控接受装置试验地决定延迟时间，以便产生适当的频率。这个模块最典型的要求是36 - 52 khz的频率。
*/
int tdelay;
unsigned long i, hz;
unsigned long time;
int outPin = 11;
void setup(){
pinMode(outPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
for (tdelay = 1; tdelay &lt; 12; tdelay++){     <br />                   // scan across a range of time delays to find the right frequency
time = millis();               // get start time of inner loop
for (i = 0; i &lt; 100000; i++){  // time 100,000 cycles through the loop
digitalWrite(outPin, HIGH);
delayMicroseconds(tdelay);
digitalWrite(outPin, LOW);
delayMicroseconds(tdelay);
}
time = millis() - time;      // compute time through inner loop in milliseconds
hz = (1 /((float)time / 100000000.0));   // divide by 100,000 cycles and 1000 milliseconds per second
// to determine period, then take inverse to convert to hertz
Serial.print(tdelay, DEC);
Serial.print(&quot;   &quot;);
Serial.println(hz, DEC);
}
}
</pre>
<h4>See also</h4>
<ul>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Delay.html">delay</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/DelayMicroseconds.html">delayMicroseconds</a> </li>
</ul>]]></description>
		</item>
		
			<item>
			<link>http://www.burncg.cn/burnblog/article.asp?id=70</link>
			<title><![CDATA[unsigned int]]></title>
			<author>24672468@sina.com(admin)</author>
			<category><![CDATA[arduino双语手册]]></category>
			<pubDate>Fri,04 Jan 2008 14:43:44 +0800</pubDate>
			<guid>http://www.burncg.cn/burnblog/default.asp?id=70</guid>
		<description><![CDATA[<h2>unsigned int</h2>
<h4>Description描述</h4>
<p>Unsigned ints (unsigned integers) are the same as ints in that they store a 2 byte value. Instead of storing negative numbers however they only store positive values, yielding a useful range of 0 to 65,535 (2^16) - 1). <br />Unsigned ints（无符号整数）和 ints一样都可以储存2byte的值。它将用于储存负数的空间用来储存正数，因此，它们能储存0 到 65,535的正值。<br /></p>
<p>The difference between unsigned ints and (signed) ints, lies in the way the highest bit, sometimes refered to as the &quot;sign&quot; bit, is interpreted. In the Arduino int type (which is signed), if the high bit is a &quot;1&quot;, the number is interpreted as a negative number, and the other 15 bits are interpreted with <a class="urllink" href="http://en.wikipedia.org/wiki/2%27s_complement" rel="nofollow">2's complement math.</a></p>
<p class="vspace">&nbsp;</p>
<h4>Example范例</h4>
<pre>    int ledPin = 13;
</pre>
<p class="vspace">&nbsp;</p>
<h4>Syntax语法</h4>
<pre>    int var = val;
</pre>
<p class="vspace">&nbsp;</p>
<ul>
    <li>var - your int variable name 你的变量名 </li>
    <li>val - the value you assign to that variable 你指定给变量的值 </li>
</ul>
<p class="vspace">&nbsp;</p>
<h4>Coding Tip编码提示</h4>
<p>When variables are made to exceed their maximum capacity they &quot;roll over&quot; back to their minimum capacitiy, note that this happens in both directions <br />当变量值超过其最大取值范围，它会&ldquo;翻转&rdquo;到它的最小值，注意它在两个方向都可能发生。</p>
<p class="vspace">&nbsp;</p>
<pre>   unsigned int x
x = 0;
x = x - 1;       // x now contains 65535 - rolls over in neg direction<br />                    // x现在为65535-翻转到它的反方向。
x = x + 1;       // x now contains 0 - rolls over<br />                    //x现在为0-翻转到它的反方向。
</pre>
<p class="vspace">&nbsp;</p>
<h4>See Also另见</h4>
<ul>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Byte.html">byte</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Int.html">int</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Long.html">long</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/UnsignedLong.html">unsigned long</a> </li>
</ul>]]></description>
		</item>
		
			<item>
			<link>http://www.burncg.cn/burnblog/article.asp?id=69</link>
			<title><![CDATA[Int]]></title>
			<author>24672468@sina.com(admin)</author>
			<category><![CDATA[arduino双语手册]]></category>
			<pubDate>Fri,04 Jan 2008 14:35:01 +0800</pubDate>
			<guid>http://www.burncg.cn/burnblog/default.asp?id=69</guid>
		<description><![CDATA[<h2>int</h2>
<h4>Description描述</h4>
<p>Integers are your primary datatype for number storage, and store a 2 byte value. This yields a range of -32,768 to 32,767 (minimum value of -2^15 and a maximum value of (2^15) - 1). <br />整数是你最初级的数据储存类型，可以储存 2 byte的值。它可以表现 -32,768到 32,767 (最小值 -2^15 最大值 (2^15) - 1)。</p>
<p class="vspace">&nbsp;</p>
<p>Int's store negative numbers with a technique called <a class="urllink" href="http://en.wikipedia.org/wiki/2%27s_complement" rel="nofollow">2's complement math.</a> The highest bit, sometimes refered to as the &quot;sign&quot; bit, flags the number as a negative number. The rest of the bits are inverted and 1 is added. <br />整数储存负数的技巧请见<a class="urllink" href="http://en.wikipedia.org/wiki/2%27s_complement" rel="nofollow">2's complement math</a>。</p>
<p class="vspace">&nbsp;</p>
<p>The Arduino takes care of dealing with negative numbers for you, so that arithmetic operations work transparently in the expected manner. There can be an unexpected complication in dealing with the <a class="wikilink" href="http://www.burncg.cn/burnblog/Bitshift.html">bitshift right operator (&gt;&gt;)</a> however. </p>
<p class="vspace">&nbsp;</p>
<h4>Example范例</h4>
<pre>    int ledPin = 13;
</pre>
<p class="vspace">&nbsp;</p>
<h4>Syntax语法</h4>
<pre>    int var = val;
</pre>
<p class="vspace">&nbsp;</p>
<ul>
    <li>var - your int variable name 你的整数变量名 </li>
    <li>val - the value you assign to that variable 你设定的变量值 </li>
</ul>
<p class="vspace">&nbsp;</p>
<h4>Coding Tip代码技巧</h4>
<p>When variables are made to exceed their maximum capacity they &quot;roll over&quot; back to their minimum capacitiy, note that this happens in both directions. <br />当变量的值超过了它的最大值后会&ldquo;翻转&rdquo;到它们的最小值，注意，在两个方向都可能发生。</p>
<p class="vspace">&nbsp;</p>
<pre>   int x
x = -32,768;
x = x - 1;       // x now contains 32,767 - rolls over in neg. direction<br />                   // x现在为 32,767-翻转到反方向。
x = 32,767;
x = x + 1;       // x now contains -32,768 - rolls over<br />                    // x现在为 -32,767-翻转到反方向。
</pre>
<p class="vspace">&nbsp;</p>
<h4>See Also</h4>
<ul>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Byte.html">byte</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/UnsignedInt.html">unsigned int</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Long.html">long</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/UnsignedLong.html">unsigned long</a> </li>
</ul>]]></description>
		</item>
		
			<item>
			<link>http://www.burncg.cn/burnblog/article.asp?id=68</link>
			<title><![CDATA[Byte]]></title>
			<author>24672468@sina.com(admin)</author>
			<category><![CDATA[arduino双语手册]]></category>
			<pubDate>Fri,04 Jan 2008 14:21:35 +0800</pubDate>
			<guid>http://www.burncg.cn/burnblog/default.asp?id=68</guid>
		<description><![CDATA[<h2>byte</h2>
<h4>Description描述</h4>
<p>Bytes store an 8-bit number, from 0 to 255. <em>byte</em> is an unsigned data type, meaning that it does not store negative numbers. <br />Bytes可以储存8-bit的数字，从0到255.它是无符号的数据类型，这意味着它不能储存负数。</p>
<p class="vspace">&nbsp;</p>
<h4>Example范例</h4>
<pre>    byte b = B10010;  // &quot;B&quot; is the binary formatter (18 decimal)
<br />                      //&quot;B&quot;是二进制的格式化程序（十进制值为18）</pre>
<p class="vspace">&nbsp;</p>
<h4>See also另见</h4>
<ul>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Int.html">int</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/UnsignedInt.html">unsigned int</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Long.html">long</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/UnsignedLong.html">unsigned long</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/IntegerConstants.html">integer constants</a> </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/Serial_Println.html">Serial.println</a> </li>
</ul>]]></description>
		</item>
		
			<item>
			<link>http://www.burncg.cn/burnblog/article.asp?id=67</link>
			<title><![CDATA[IncrementCompound]]></title>
			<author>24672468@sina.com(admin)</author>
			<category><![CDATA[arduino双语手册]]></category>
			<pubDate>Fri,04 Jan 2008 14:16:33 +0800</pubDate>
			<guid>http://www.burncg.cn/burnblog/default.asp?id=67</guid>
		<description><![CDATA[<h2>+= , -= , *= , /= </h2>
<h4>Description描述</h4>
<p>Perform a mathematical operation on a variable with another constant or variable. The += (et al) operators are just a convenient shorthand for the expanded syntax, listed below. <br />对一个变量和另一个参数或变量完成一个数学运算。+=（以及其他）可以缩短语法长度。</p>
<p class="vspace">&nbsp;</p>
<h4>Syntax语法</h4>
<pre>x += y;   // equivalent to the expression x = x + y;<br />          // 等价于 x = x + y;
x -= y;   // equivalent to the expression x = x - y; <br />          // 等价于 x = x - y;
x *= y;   // equivalent to the expression x = x * y; <br />          // 等价于 x = x * y;
x /= y;   // equivalent to the expression x = x / y; <br />          // 等价于 x = x / y;
</pre>
<p class="vspace">&nbsp;</p>
<h4>Parameters参数</h4>
<p>x: any variable type <br />x：任何变量类型</p>
<p class="vspace">&nbsp;</p>
<p>y: any variable type or constant <br />y：任何变量类型或常数</p>
<p class="vspace">&nbsp;</p>
<h4>Examples范例</h4>
<pre>x = 2;
x += 4;      // x now contains 6<br />             // x现在为6
x -= 3;      // x now contains 3<br />             // x现在为3
x *= 10;     // x now contains 30<br />             // x现在为30
x /= 2;      // x now contains 15<br />             // x现在为15
</pre>]]></description>
		</item>
		
			<item>
			<link>http://www.burncg.cn/burnblog/article.asp?id=66</link>
			<title><![CDATA[Increment]]></title>
			<author>24672468@sina.com(admin)</author>
			<category><![CDATA[arduino双语手册]]></category>
			<pubDate>Fri,04 Jan 2008 14:10:09 +0800</pubDate>
			<guid>http://www.burncg.cn/burnblog/default.asp?id=66</guid>
		<description><![CDATA[<h2>++ (increment) / -- (decrement)</h2>
<h4>Description描述</h4>
<p>Increment or decrement a variable <br />增加或消耗变量</p>
<p class="vspace">&nbsp;</p>
<h4>Syntax语法</h4>
<pre>x++;  // increment x by one and returns the old value of x
<br />      // 将x的值加1并返回原来的x的值。    <br />++x;  // increment x by one and returns the new value of x<br />      // 将x的值加1并返回现在的x的值。   <br />
x-- ;   // decrement x by one and returns the old value of x <br />      // 将x的值减1并返回原来的x的值。   <br />
--x ;   // decrement x by one and returns the new value of x  <br />      // 将x的值减1并返回现在的x的值。</pre>
<p class="vspace">&nbsp;</p>
<h4>Parameters参数</h4>
<p>x: an integer or long (possibly unsigned) <br />x：一个整数或长整数（可以无符号）</p>
<p class="vspace">&nbsp;</p>
<h4>Returns返回</h4>
<p>The original or newly incremented / decremented value of the variable. <br />返回变量原始值或增加/消耗后的新值。</p>
<p class="vspace">&nbsp;</p>
<h4>Examples范例</h4>
<pre>x = 2;
y = ++x;      // x now contains 3, y contains 3<br />              // x现在为3，y为3
y = x--;      // x contains 2 again, y still contains 3<br />              // x现在仍然为2，y将为3
</pre>
<p class="vspace">&nbsp;</p>
<h4>See also另见</h4>
<p><a class="wikilink" href="http://www.burncg.cn/burnblog/Arithmetic.html">+=</a><br /><a class="wikilink" href="http://www.burncg.cn/burnblog/Arithmetic.html">-=</a> </p>]]></description>
		</item>
		
			<item>
			<link>http://www.burncg.cn/burnblog/article.asp?id=65</link>
			<title><![CDATA[Boolean]]></title>
			<author>24672468@sina.com(admin)</author>
			<category><![CDATA[arduino双语手册]]></category>
			<pubDate>Fri,04 Jan 2008 13:56:37 +0800</pubDate>
			<guid>http://www.burncg.cn/burnblog/default.asp?id=65</guid>
		<description><![CDATA[<h1>Boolean Operators </h1>
<p>These can be used inside the condition of an <a class="wikilink" href="http://www.burncg.cn/burnblog/If.html">if</a> statement.<br />它们可以在条件或条件语句中使用。</p>
<p class="vspace">&nbsp;</p>
<h3>&amp;&amp; (logical and逻辑和)</h3>
<p>True only if both operands are true, e.g. <br />仅两个操作符都为真时才为真，例如：</p>
<pre>
if (digitalRead(2) == 1  &amp;&amp; digitalRead(3) == 1) { // read two switches
// ...
}
</pre>
<p>is true only if x is 1, 2, 3, or 4. </p>
<p class="vspace">&nbsp;</p>
<h3>|| (logical or逻辑与)</h3>
<p>True if either operand is true, e.g. <br />如果任意一个为真，就为真，例如：</p>
<pre>if (x &gt; 0 || y &gt; 0) {
// ...
}
</pre>
<p>is true if either x or y is greater than 0. <br />只要x或y任意一个大于0，就为真。</p>
<p class="vspace">&nbsp;</p>
<h3>! (not非)</h3>
<p>True if the operand is false, e.g. <br />如果操作符为假时，就为真，例如：</p>
<pre>if (!x) {
// ...
}
</pre>
<p>is true if x is false (i.e. if x equals 0). <br />如果x为假时（例如x为0），就为真。</p>
<p class="vspace">&nbsp;</p>
<h4>Warning警告</h4>
<p>Make sure you don't mistake the boolean AND operator, &amp;&amp; (double ampersand) for the bitwise AND operator &amp; (single ampersand). They are entirely different beasts. <br />确定你没有错误的使用逻辑和操作符&amp;&amp;和位操作符&amp;，它们是完全不同的。</p>
<p class="vspace">&nbsp;</p>
<p>Similarly, do not confuse the boolean || (double pipe) operator with the bitwise or operator | (single pipe). <br />同样的，确定你没有错误的使用逻辑与操作符||和位操作符|。</p>
<p class="vspace">&nbsp;</p>
<p>The bitwise not ~ (tilde) looks much different than the boolean not ! (exclamation point or &quot;bang&quot; as the programmers say) but you still have to be sure which one you want where. <br />位操作符非~看起来和逻辑非操作符！（感叹号或程序员常说的 &quot;bang&quot;）非常不同，但你仍然需要知道哪一个才是这里需要的。</p>
<p class="vspace">&nbsp;</p>
<h4>Examples范例</h4>
<pre>if (a &gt;= 10 &amp;&amp; a &lt;= 20){}   // true if a is between 10 and 20
// a在10到20之间时为真
</pre>
<p class="vspace">&nbsp;</p>
<h4>See also另见</h4>
<ul>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/BitwiseAnd.html">&amp;</a> (bitwise AND) </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/BitwiseAnd.html">|</a> (bitwise or) </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/BitwiseXorNot.html">~</a> (bitwise NOT </li>
    <li><a class="wikilink" href="http://www.burncg.cn/burnblog/If.html">if</a> </li>
</ul>]]></description>
		</item>
		
			<item>
			<link>http://www.burncg.cn/burnblog/article.asp?id=64</link>
			<title><![CDATA[Arithmetic]]></title>
			<author>24672468@sina.com(admin)</author>
			<category><![CDATA[arduino双语手册]]></category>
			<pubDate>Fri,04 Jan 2008 13:37:49 +0800</pubDate>
			<guid>http://www.burncg.cn/burnblog/default.asp?id=64</guid>
		<description><![CDATA[<h2>Addition, Subtraction, Multiplication, &amp; Division</h2>
<h4>Description描述</h4>
<p>These operators return the sum, difference, product, or quotient (respectively) of the two operands. The operation is conducted using the data type of the operands, so, for example, <code>9 / 4</code> gives <code>2</code> since 9 and 4 are ints. This also means that the operation can overflow if the result is larger than that which can be stored in the data type. If the operands are of different types, the &quot;larger&quot; type is used for the calculation. <br />这些函数将返回两个操作数值的计算结果。采用操作数的数据类型进行计算，例如， <code>9 / 4</code>将返回2，因为9和4是整数。这也意味着如果结果超出了数据类型的储存范围将会导致数据溢出。如果操作数的数据类型不同，那么，较多的数据类型将被计算采用。</p>
<p class="vspace">&nbsp;</p>
<p>If one of the numbers (operands) are of the type <strong><a href="http://www.burncg.cn/burnblog/article.asp?id=63">float</a></strong> or of type <strong><a href="http://www.burncg.cn/burnblog/article.asp?id=62">double</a></strong>, floating point math will be used for the calculation. <br />如果操作数的数据类型是 <strong><a href="http://www.burncg.cn/burnblog/article.asp?id=63">float</a></strong>或者 <strong><a href="http://www.burncg.cn/burnblog/article.asp?id=62">double</a></strong>，那么就会以浮点来进行计算。</p>
<p class="vspace">&nbsp;</p>
<h4>Examples范例</h4>
<pre>y = y + 3;
x = x - 7;
i = j * 6;
r = r / 5;
</pre>
<p class="vspace">&nbsp;</p>
<h4>Syntax语法</h4>
<pre>result = value1 + value2;
result = value1 - value2;
result = value1 * value2;
result = value1 / value2;
</pre>
<p class="vspace">&nbsp;</p>
<h4>Parameters:</h4>
<p>value1: any variable or constant<br />value1:任意变量或常数。</p>
<p>value2: any variable or constant <br />value2:任意变量或常数。</p>
<p class="vspace">&nbsp;</p>
<h4>Programming Tips:技巧</h4>
<ul>
    <li>Choose variable sizes that are large enough to hold the largest results from your calculations <br />增加变量长度，以便保存更长的计算结果
    <p class="vspace">&nbsp;</p>
    </li>
    <li>Know at what point your variable will &quot;roll over&quot; and also what happens in the other direction e.g. (0 - 1) or (0 - - 32768) <br />明白为什么你的变量会产生&ldquo;翻转&rdquo;，或偶然发生方向改变。例如（0 - 1）或（0 - - 32768）。
    <p class="vspace">&nbsp;</p>
    </li>
    <li>For math that requires fractions, use float variables, but be aware of their drawbacks: large size, slow computation speeds <br />如果数学计算需要分数，那么就要使用浮点变量，但也要知道它的缺点：体积大，计算速度慢。
    <p class="vspace">&nbsp;</p>
    </li>
    <li>Use the cast operator e.g. (int)my Float to convert one variable type to another on the fly. </li>
</ul>]]></description>
		</item>
		
</channel>
</rss>
