代码中简单实现四舍五入(加上0.5取整)适用于所有语言

int representGoal = (int) (graph.goal*representRatio+0.5);

只需要加0.5取整。

posted on 2013-11-29 10:41  代码王子  阅读(461)  评论(0编辑  收藏  举报

导航