一个四舍五入函数

    技术2022-05-11  82

    一个四舍五入函数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;

    最新回复(0)