一个四舍五入函数http://www.tommstudio.com(2001年4月19日) 作者:booktian 推荐:booktian
|
下面是保岛国整数的四舍五入函数,如果要保岛国n位小数,只需简单修改。function myround(x : extended) : extended;beginif (int(x)*10+5) > int(x*10) thenbeginresult := floor(x);end elsebeginresult := ceil(x);end;end; |
|
转载请注明原文地址: https://ibbs.8miu.com/read-18944.html