Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
div
eof
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

ceil, ceilf 

Calculates 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
);

Parameters

x

Floating-point 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.

C++ allows overloading, so you can call overloads of ceil. In a C program, ceil always takes and returns a double.

Routine Required header Compatibility

ceil, ceilf

<math.h>

ANSI, Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003

For additional compatibility information, see Compatibility in the Introduction.

See the example for floor.

Community Additions

ADD
Show:
© 2015 Microsoft