有个函数可以解决,trunc(实数).

解决方案 »

  1.   

    向上取整int(float)+1
    向下取整int(float)
    四舍五入int(float+0.5)在C语言中,可以不用函数
    向上取整((float/1.0)+0.99)/1
    向下取整float/1
    四舍五入(float+0.5)/1
      

  2.   

    Trunc(3.6+1)
    结果就是4~
    Trunc就是取数字的整数部分~
      

  3.   

    Ceil(3.6)=4;
    在uses部分加上math.
      

  4.   

    如果是取整的话,可用Round(x),比如:
      x:=4.66;
      Round(x)=5;
      

  5.   

    Ceil(3.6)=4;
    在uses部分加上math. math.pas提供的标准方法,
    Floor和Ceil。
      

  6.   

    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.