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 poweredAI로 LaTeX 작성

최고의 AI LaTeX 편집기, Overleaf 대안

Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움

  • AI로 아름다운 TikZ 다이어그램 생성
  • 이미지를 업로드하고 LaTeX로 원활하게 변환
  • 논문 작성 및 서식에 대한 즉각적인 지원 받기