[英]Strange behavior when dividing
快速提問,但這讓我發瘋:
是不是:
return c*(t/=d/2)*t*t + b;
與:
t = t/d/2;
return c*(t)*t*t + b;
因為好像不是,所以我得到了不同的結果。
/運算符是左關聯的。 這意味着
t = t/d/2;
是相同的:
t = (t/d)/2;
當然,
t /= d/2;
可以做到:
t = t/(d/2);
ActionScript文檔: http : //help.adobe.com/zh_CN/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7fd1.html#WS5b3ccc516d4fbf351e63e3d118a9b90204-7f68
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.