-->
The Math.ceil function in JavaScript is used to round the number passed as parameter to its nearest integer in Upward direction of rounding i.e towards the greater value. Math.ceil(value) Parameters: The number to be rounded to its nearest integer in upward rounding method. Ceil(+2.4) = 3.000000 ceil(-2.4) = -2.000000 ceil(-0.0) = -0.000000 ceil(-Inf) = -INF See also. Floor floorf floorl. Cprogramming.com is a web site devoted to the C programming language. It has general, and graphics, programming tutorials, source code, selected links, and an active programming message board. Ceil - C Function Reference - Cprogramming.com. C round The round function in C returns the integral value that is nearest to the argument, with halfway cases rounded away from zero.
Calculates the ceiling of a value.
Syntax
Parameters
x
Floating-point value.
Floating-point value.
Return Value
The ceil functions return a floating-point value that represents the smallest integer that is greater than or equal to x. There is no error return.
Ceil Cpp
Input | SEH Exception | Matherr Exception |
---|---|---|
± QNAN, IND | none | _DOMAIN |
ceil has an implementation that uses Streaming SIMD Extensions 2 (SSE2). For information and restrictions about using the SSE2 implementation, see _set_SSE2_enable.
Remarks
Because C++ allows overloading, you can call overloads of ceil that take float or longdouble types. In a C program, ceil always takes and returns a double.
By default, this function's global state is scoped to the application. To change this, see Global state in the CRT.
Requirements
C++ Std Ceil
Routine | Required header |
---|---|
ceil, ceilf, ceill | <math.h> |
For additional compatibility information, see Compatibility.
Example
See the example for floor.
See also
Floating-Point Support
floor, floorf, floorl
fmod, fmodf
round, roundf, roundl
floor, floorf, floorl
fmod, fmodf
round, roundf, roundl