嘿,让我们直接跳转到一个代码示例显示的ECMAScript/JavaScript的/ AS3怎么不能做简单的数学权(AS3使用了数类的IEEE-754双精度浮点数"按理说它是相同的用于JavaScript)...
trace(1.1); //'1.1': Ok, fine, looks good.
trace(1.1*100); //'110.00000000000001': What!?
trace((1.1*100)/100); //'1.1': Brings it back to 1.1 (since we're apparently multiplying by *approximately* 100 and then dividing by the same *approximate* '100' amount)
trace(1.1*100-110); //'1.4210854715202004e-14': Proof that according to AS3, 1.1*100!=110 (i.e. this isn't just a bug in Number.toString())
trace(1.1*100==110); //'false': Even further proof that according to AS3, 1.1*100!=110
Run Code Online (Sandbox Code Playgroud)
是什么赋予了?