ActionScript 3.0算术运算符
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3.0算术运算符相关的知识,希望对你有一定的参考价值。
This snippet is used for the blog post called Arithmetic Operators in Flash and ActionScript 3.0, which can be found at http://www.brettwidmann.com/2010/10/arithmetic-operators-in-flashactionscript-3-0 which is set to publish on November 1, 2010.
/* Each trace function demonstrates the type of Arithmetic operators in Flash. Commented out trace() functions demonstrate an easier to read example while the verbose versions represent cleaner formatting in the console.*/ //Addition trace("The sum of 15 + 6 is: " + (15 + 6)); //trace(15 + 6); trace(" "); //Subtraction trace("The difference of 15 and 6 is: " + (15 - 6) ); //trace(15 - 6); trace(" "); //Multiplication trace("The product of 15 and 6 is: " + (15 * 6)); //trace(15 * 6); trace(" "); //Division trace("The quotient of 15 and 6 is: " + (15 / 6)); //trace(15 / 6); trace(" "); //Modulo trace("The modulus (remainder) of 15 and 6 is: " + (15 % 6)); //trace(15 % 6); trace(" "); //Order of Operations Example 1 trace("Parentheticals take precedence in Arithmetic!"); trace("(4 * 2) + 6 = " + ((4 * 2) + 6)); //trace((4 * 2) + 6); trace(" "); //Order of Operations Example 2 trace("(10 + 6) * 3 = " + ((10 + 6) * 3)); trace(" "); //String Concatenation Example var concatSentence:String = "This is an example of " + "string concatenation."; trace(concatSentence);
以上是关于ActionScript 3.0算术运算符的主要内容,如果未能解决你的问题,请参考以下文章
获取 badarith,[erlang,'+',[error,0],[],同时使用 Erlang 片段在 TSUNG 中执行算术运算
[ActionScript 3.0] as3处理xml的功能和遍历节点