Floor in LaTeX (\lfloor x \rfloor)

⌊x⌋\lfloor x \rfloor
LaTeX command
\lfloor x \rfloor
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Rounds x down to the greatest integer less than or equal to it: the floor function.

The floor appears in integer division, in the fractional part \{x\} = x - \lfloor x \rfloor, in the binary search midpoint \lfloor (lo + hi)/2 \rfloor, and in number theory sums like Legendre's formula. For negative numbers it rounds away from zero: \lfloor -2.5 \rfloor = -3, which differs from truncation. Older literature wrote [x] for the floor (the Gauss bracket), but the bracket notation is now preferred because it is unambiguous. Use \left\lfloor ... \right\rfloor around fractions so the brackets match the content height.

Also listed under: 정수론, 컴퓨터 과학

Minimal compilable example

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

x−1<⌊x⌋≤xx - 1 < \lfloor x \rfloor \le x
\documentclass{article}
\begin{document}
Floor: $\lfloor x \rfloor$

\[ x - 1 < \lfloor x \rfloor \le x \]
\end{document}

Related symbols

All 괄호 및 구분자 →

Frequently asked questions

How do I write Floor in LaTeX?
Type \lfloor x \rfloor in math mode, for example $x - 1 < \lfloor x \rfloor \le x$. It works in plain LaTeX without loading any package.
Which package do I need for \lfloor x \rfloor?
None. \lfloor x \rfloor is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \lfloor x \rfloor in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\lfloor x \rfloor$ in running text.
Math poweredAI로 LaTeX 작성

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

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

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