Ceiling 
Details
- Mathematical function, suitable for both symbolic and numerical manipulation.
- Ceiling[x] can be entered in StandardForm and InputForm as ⌈x⌉,
lc
rc
or
\[LeftCeiling]x \[RightCeiling]. » - Ceiling[x] returns an integer when
is any numeric quantity, whether or not it is an explicit number. - Ceiling[x] applies separately to real and imaginary parts of complex numbers.
- If a is not a positive real number, Ceiling[x,a] is defined by the formula Ceiling[x,a]a Ceiling[x/a]. »
- For exact numeric quantities, Ceiling internally uses numerical approximations to establish its result. This process can be affected by the setting of the global variable $MaxExtraPrecision.
- Ceiling automatically threads over lists. »
Examples
open all close allBasic Examples (4)
Round up to the nearest integer:
Ceiling[2.4]Ceiling[2.6]Round up to the nearest multiple of 10:
Ceiling[226, 10]Plot the function over a subset of the reals:
Plot[Ceiling[x], {x, -3, 3}]Use
lc
and
rc
to enter a short notation for Ceiling:
⌈x⌉Scope (30)
Numerical Evaluation (7)
Ceiling[5.37]Ceiling[-3.7]Ceiling[-10.3, 3.5]Ceiling[2Pi - E, 5 / 4]Ceiling[5.37 - 1.3I]Single-argument Ceiling always returns an exact result:
Ceiling[123.4`45]The two-argument form tracks the precision of the second argument:
Ceiling[100`45, 13.2456`10]Evaluate efficiently at high precision:
Ceiling[7545 / 4660`10000]//TimingN[Ceiling[(E + Pi) ^ 2 - E ^ 2 - Pi ^ 2 - 2 E Pi], 10^5]//Quiet//TimingCeiling can deal with real‐valued intervals:
Ceiling[Interval[{-1, 3 / 2}]]Compute the elementwise values of an array using automatic threading:
**Ceiling**[{{1 / 2, -1}, {0, -1 / 2}}]Or compute the matrix Ceiling function using MatrixFunction:
MatrixFunction[Ceiling, {{1 / 2, -1}, {0, -1 / 2}}]Compute average-case statistical intervals using Around:
Ceiling[ Around[-1, 0.01]]Specific Values (6)
Values of Ceiling at fixed points:
Table[Ceiling[n ], {n, {1 / 7, 5 / 4, 7 / 3, 7 / 2}}]Ceiling[0]Value at Infinity:
Ceiling[∞]PiecewiseExpand[Ceiling[x, 2], 0 < x < 4]Manipulate Ceiling symbolically:
Simplify[Ceiling[x] + Ceiling[x + 1]]Reduce[Ceiling[x] + Ceiling[2x + 1] == 0, x, Reals]Find a value of x for which the Ceiling[x]=2:
xval = x /. FindRoot[Ceiling[x] == 2, {x, 1.5}]Plot[Ceiling[x], {x, -2, 3}, Epilog -> Style[Point[{xval, Ceiling[xval]}], PointSize[Large], Red], ExclusionsStyle -> Dotted]Visualization (4)
Plot the Ceiling function:
Plot[Ceiling[x], {x, -3, 3}, Filling -> Axis]Visualize the two-argument form:
Plot[Ceiling[x, .5], {x, -3, 3}, Filling -> Axis]Plot Ceiling in three dimensions:
Plot3D[Ceiling[x, y], {x, -3, 3}, {y, -3, 3}, ColorFunction -> "BlueGreenYellow"]Visualize Ceiling in the complex plane:
ComplexPlot3D[Ceiling[z], {z, 3}, PlotLegends -> Automatic]Function Properties (9)
Ceiling is defined for all real and complex inputs:
FunctionDomain[Ceiling[x], x]FunctionDomain[Ceiling[x], x, Complexes]Ceiling can produce infinitely large and small results:
FunctionRange[Ceiling[x], x, y]//QuietCeiling is not an analytic function:
FunctionAnalytic[Ceiling[x], x]It has both singularities and discontinuities:
FunctionSingularities[Ceiling[x], x]FunctionDiscontinuities[Ceiling[x], x]Ceiling is nondecreasing:
FunctionMonotonicity[Ceiling[x], x]Ceiling is not injective:
FunctionInjective[Ceiling[x, 5], x]Plot[{Ceiling[x, 5], 5}, {x, -20, 20}, PlotStyle -> {Thick}]Ceiling is not surjective:
FunctionSurjective[Ceiling[x, 5], x]Plot[{Ceiling[x, 5], -2}, {x, -20, 20}, PlotStyle -> {Thick}]Ceiling is neither non-negative nor non-positive:
FunctionSign[Ceiling[x], x]Ceiling is neither convex nor concave:
FunctionConvexity[Ceiling[x], x]TraditionalForm formatting:
Ceiling[n]//TraditionalFormDifferentiation and Integration (4)
First derivative with respect to x:
D[Ceiling[x], x]First derivative with respect to a:
D[Ceiling[x, a], a]//FullSimplifyDefinite integrals of Ceiling:
Integrate[Ceiling[x], {x, 0, E}]Integrate[Ceiling[x ^ 2], {x, 0, 3}]Series[Ceiling[x ^ 2], {x, 1, 2}, Assumptions -> Element[x, Reals]]Applications (4)
Plot[Ceiling[x + x ^ 2], {x, -3, 3}]Plot3D[Ceiling[x y], {x, -2, 2}, {y, -2, 2}]Self‐counting sequence:
Table[Ceiling[(Sqrt[8k + 1] - 1) / 2], {k, 21}]Minimal number of elements in a box according to the pigeonhole principle:
Plot3D[Ceiling[n / k], {k, 1, 10}, {n, 1, 10}, Mesh -> False, AxesLabel -> {"boxes", "elements", None}]Properties & Relations (10)
Negative numbers round up to the nearest integer above:
Ceiling[{-2.4, -2.5, -2.6}]For a>0, Ceiling[x,a] gives the least multiple of a greater than or equal to x:
Ceiling[16, 3]For other values of a, Ceiling[x,a] is defined by the following formula:
FunctionExpand[Ceiling[x, a]]For a<0, the result is less than or equal to x:
{Ceiling[x, a], %} /. {x -> 16, a -> -3}Ceiling[x,-a] is equal to Floor[x,a]:
FullSimplify[Ceiling[x, -a] == Floor[x, a]]PiecewiseExpand[Ceiling[x ^ 2], 0 < x < 2]Denest Ceiling functions:
PiecewiseExpand[Ceiling[x + 1 / 3 + Ceiling[1 - x / 2] ^ 3], x∈Reals && -1 < x < 1]Reduce equations containing Ceiling:
Reduce[Ceiling[x + (1/2)] == 2 Ceiling[x]∧-1 < x < 1 , {x}, Reals]Ceiling function in the complex plane:
DensityPlot[Abs[Ceiling[x + I y]], {x, -3, 3}, {y, -3, 3}]Ceiling can be represented as a DifferenceRoot:
DifferenceRootReduce[Ceiling[k], k]DifferenceRootReduce[Ceiling[k, 3], k]The generating function for Ceiling:
GeneratingFunction[Ceiling[n, 4], n, x]Series[%, {x, 0, 10}]The exponential generating function for Ceiling:
ExponentialGeneratingFunction[Ceiling[n, 4], n, x]Possible Issues (1)
Ceiling does not automatically resolve the value:
Ceiling[π ^ 2 + 2π + 1 - (π + 1) ^ 2]Simplify[%]Neat Examples (1)
Convergence of the Fourier series of Ceiling:
Plot[Evaluate[Table[x + 1 / 2 + Sum[Sin[2Pi k x] / k, {k, 1, o}] / Pi, {o, 10}]],
{x, -2, 2}]See Also
Floor IntegerPart FractionalPart Round Chop BinCounts Quantile FindDivisions
Function Repository: MinMaxRounded
Related Guides
History
Introduced in 1988 (1.0) | Updated in 1996 (3.0) ▪ 2007 (6.0)
Text
Wolfram Research (1988), Ceiling, Wolfram Language function, https://reference.wolfram.com/language/ref/Ceiling.html (updated 2007).
CMS
Wolfram Language. 1988. "Ceiling." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/Ceiling.html.
APA
Wolfram Language. (1988). Ceiling. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Ceiling.html
BibTeX
@misc{reference.wolfram_2026_ceiling, author="Wolfram Research", title="{Ceiling}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Ceiling.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_ceiling, organization={Wolfram Research}, title={Ceiling}, year={2007}, url={https://reference.wolfram.com/language/ref/Ceiling.html}, note=[Accessed: 13-June-2026]}