Ceil Function
The Ceil function is used to evaluate the smallest integer not less than the given real number. Ceil (2) = Ceil (1.2) = CEI (1.5) = 2.00 |
To use this function, you must include the header file <math. h>. The return value of this function is floating point.
Run-Time library referenceceil, ceilfcalculates the ceiling of a value.
Double Ceil (
Double X
);
Float Ceil (
Float x
); // C ++ only
Long Double Ceil (
Long Double X
); // C ++ only
Float ceilf (
Float x
);
Parameter
X
Floating-point value.
Return Value
The Ceil function returns a double value representing the smallest integer that is greater than or equal to X. There is no error return.
Input seh exception matherr exception
± Qnan, IND None _ domain
Ceil has an implementation that uses streaming SIMD extensions 2 (sse2). See _ set_sse2_enable for information and restrictions on using the sse2 implementation.
Remarks
C ++ allows overloading, so you can call overloads of Ceil. In a C program, Ceil always takes and returns a double.
Requirements
Routine required header compatibility
Ceil, ceilf <math. h> ANSI, WIN 98, win me, Win NT, Win 2000, Win XP
For additional compatibility information, see compatibility in the introduction.
Libraries
All versions of the C run-time libraries.
Example
See the example for floor.