*------------- Telecommunications & Signal Processing Lab --------------
*                          McGill University
*
*
* Module:
*     REAL FUNCTION CEILX (X)
*
*
* Purpose:
*     Calculate the ceiling function
*
*
* Description:
*     This function calculate the ceiling function of x.  It returns
*     the smallest integer that is greater than or equal to x.
*
*
* Parameters:
* R <-  CEILX  - Returned integer value (of type REAL)
*
* R ->  X      - Input value
*
*
* Author / revision:
*     P. Kabal
*     $Revision: 1.4 $  $Date: 1995/03/08 15:26:29 $
*
*
*-----------------------------------------------------------------------

      REAL FUNCTION CEILX (X)


      REAL X


* For negative values, AINT(.) works as the ceiling function
      CEILX=AINT(X)
      IF (X.GT.0.0 .AND. X.NE.CEILX) CEILX=CEILX+1.


      RETURN

      END
