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: Teori Bilangan, Ilmu Komputer

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 Tanda Kurung & Pembatas →

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 poweredTulis LaTeX menggunakan AI

Editor LaTeX AI Terbaik, Alternatif Overleaf

Octree membantu peneliti dari 15+ universitas menulis makalah penelitian lebih cepat menggunakan AI

  • Hasilkan diagram TikZ yang indah menggunakan AI
  • Unggah gambar dan konversi ke LaTeX dengan mulus
  • Dapatkan bantuan instan untuk menulis dan memformat makalah penelitian