1、IntPower()
function IntPower(const Base: Extended; const Exponent: Integer): Extended register;
作用:Calculates the integral power of a base value.//计算一个数的整数幂
2、abs()
function Abs(X);
作用:Returns an absolute value.//返回一个数的绝对值
3、Frac()
function Frac(X: Extended): Extended;
作用:Returns the fractional part of a real number.//返回一个实数的小数部分
由这个三个函数可以写一个自定义的四舍五入的函数:
本文介绍了如何使用IntPower()、abs() 和 Frac() 函数,并结合这些函数实现了一个自定义的四舍五入函数 Round45()。该函数能够对实数进行精确到指定小数位数的四舍五入处理。

347

被折叠的 条评论
为什么被折叠?



