是精度的问题。
AS3's Number type, like Java's or C++'s 'double' type, store floating-point
values using binary fractions, not decimal fractions, so there is some loss of
precision occuring. There is no fractional-decimal type in AS3.
I'll leave it to folks in the developer community working on financial
applications to explain how they work around this limitation.
Gordon Smith
Adobe Flex SDK Team
http://zengrong.net/post/1186.htm
解决方式或许可以采用 toFixed() ?
http://livedocs.adobe.com/flash/9.0_tw/ActionScriptLangRefV3/Number.html
※ 引述《pino0707 (威士登)》之铭言:
: var num:Number=0.7;
: var num2:Number=0.3;
: trace(num-num2)
: 会呈现0.399999997这种数字...
: 这是什么原因呢?