警惕:as3整除会除出小数

比如你在程序里面trace(5/2);结果会是2.5!!!而不是2,这个在写循环条件的时候会导致程序出一些莫名奇妙的bug!警惕了,昨天大家找了好久就是这个引起的!!!!,以后如果不想得到这样的结果一定要强制转换成uint类型!!!!!!!!!

]]>

发表评论?

1 条评论。

发表评论


注意 - 你可以用以下 HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>