Ceiling in LaTeX (\lceil x \rceil)

⌈x⌉\lceil x \rceil
LaTeX command
\lceil x \rceil
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Rounds x up to the smallest integer greater than or equal to it: the ceiling function.

Ceilings show up in algorithm analysis (\lceil \log_2 n \rceil comparisons, \lceil n/2 \rceil in merge sort), in number theory, and in counting problems like the pigeonhole principle, where some box holds at least \lceil n/k \rceil items. For negative inputs remember that \lceil -2.5 \rceil = -2. When the argument is a fraction or a tall expression, use \left\lceil ... \right\rceil so the brackets grow. Do not substitute square brackets [x]: older texts used [x] for the floor, which makes it ambiguous.

Also listed under: نظرية الأعداد, علوم الحاسوب

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

⌈nk⌉≥nk\left\lceil \frac{n}{k} \right\rceil \ge \frac{n}{k}
\documentclass{article}
\begin{document}
Ceiling: $\lceil x \rceil$

\[ \left\lceil \frac{n}{k} \right\rceil \ge \frac{n}{k} \]
\end{document}

Related symbols

All الأقواس والمحددات →

Frequently asked questions

How do I write Ceiling in LaTeX?
Type \lceil x \rceil in math mode, for example $\left\lceil \frac{n}{k} \right\rceil \ge \frac{n}{k}$. It works in plain LaTeX without loading any package.
Which package do I need for \lceil x \rceil?
None. \lceil x \rceil is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \lceil x \rceil in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\lceil x \rceil$ in running text.
Math poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث