Round functionReturns the value of X rounded to the nearest whole number.UnitSystemCategoryarithmetic routinesfunction Round(X: Extended): Int64;DescriptionThe Round function rounds a real-type value to an integer-type value.X is a real-type expression. Round returns an Int64 value that is the value of X rounded to the nearest whole number. If X is exactly halfway between two whole numbers, the result is always the even number.If the rounded value of X is not within the Int64 range, a run-time error is generated, which can be handled using the EInvalidOp exception.
向下取整int(float)
四舍五入int(float+0.5)在C语言中,可以不用函数
向上取整((float/1.0)+0.99)/1
向下取整float/1
四舍五入(float+0.5)/1
结果就是4~
Trunc就是取数字的整数部分~
在uses部分加上math.
x:=4.66;
Round(x)=5;
在uses部分加上math. math.pas提供的标准方法,
Floor和Ceil。