How to write the floor symbol in LaTeX?

How to write the floor symbol in LaTeX?

This post may contain affiliate links that allow us to earn a commission at no expense to you. Learn more

This article aims to show you the simplest and easiest way to write the floor symbol in LaTeX.

This symbol is typically used in mathematics and computer science, usually when you are studying functions or creating code regarding functions. Today you will learn how to write this symbol in LaTeX.

Floor function 

In math and computer science, whenever the floor function is applied to a number, it returns the greatest integer less than or equal to the given real number value x. You can define it using “floor(x)” or with two “half” square brackets with the value x between them. 

Floor Symbol In LaTeX : Floor symbol or sign. Images created with LaTeX by the author.
Floor symbol or sign. Images created with LaTeX by the author.

Floor symbol in LaTeX

To write it we do not need extra packages, it is already by default in its built-in LaTeX symbols, that’s great news. First of all the math mode is mandatory for this expression, second we need two commands one for each side of the values used as arguments of the function, the first command is \lfloor (left side) and the second one is \rfloor (right side); therefore the argument will be between these two commands, for example

\documentclass{article}
\begin{document}
\begin{center}
    \verb|lfloor| \verb|[argument]| \verb|rfloor|\\
    $\lfloor 2, -3, 5 \rfloor$\\
    $\lfloor x \rfloor$\\
\end{center}
\end{document}

Gives the output

Floor Symbol In LaTeX : Explanation for the denoted floor function. Images created with LaTeX by the author.
Explanation for the denoted floor function. Images created with LaTeX by the author.

We can notice what was mentioned before, the argument or value evaluated in the function is between both commands in the code. 

In case we have a fraction or maybe the floor symbols do not fit, we can use two already known commands, \left and \right. Let’s look at an example

\begin{document}
\begin{center}
    1) $\lfloor \dfrac{1}{x} \rfloor$ \\
    \vspace{0.2cm}
    2) $\left \lfloor \dfrac{1}{x} \right \rfloor$
\end{center}
\end{document}
Floor Symbol In LaTeX : With and without \left \right expressions. Images created with LaTeX by the author.
With and without \left \right expressions. Images created with LaTeX by the author.

Note: \vspace{} creates a vertical space between two lines, the height of the space is defined by the value inside the brackets.

Ceiling Function and Ceiling Symbol in LaTeX

Just as we have the floor functions there is also the opposite of it. The ceiling function, also denoted ceil(x), returns the last integer greater than or equal to a given real number x. The symbols are the same as the floor function, except they are inverted, 

Floor Symbol In LaTeX : Images created with LaTeX by the author.
Images created with LaTeX by the author.

In LaTeX we use \lceil and \rceil commands for each side of the ceiling function, the same principle from the floor function symbols apply for the ceil symbols. For example

\begin{center}
    1) $\left \lceil \dfrac{x^2}{3} \right \rceil$\\
    \vspace{0.2cm}
    2) $\lceil 5.4 \rceil$
\end{center}
\end{document}
Floor Symbol In LaTeX : Ceiling function; Images created with LaTeX by the author.
Ceiling function; Images created with LaTeX by the author.

Here we have the basics  for writing these two symbols and respective functions in LaTeX. There could be packages to help you write these symbols in different ways but most of the time, simpler is better or at least that is what we want to transmit whenever we can.

I hope this post was helpful, and as always keep writing in LaTeX.

All the images were created with LaTeX by the author.

Further Reading

LaTex Tutorial on Symbols

  1. How To Create A Cross Product Symbol In LaTeX
  2. How to create a hat symbol in LaTeX?
  3. How to create a prime symbol in LaTeX?
  4. How to create an absolute value symbol in LaTeX?
  5. How to create an approximate symbol in LaTeX?
  6. How to create an intersection symbol in LaTeX?
  7. How to create the empty set symbol in LaTeX?
  8. How to write a degree symbol in LaTeX?
  9. How to write a dot product in LaTeX?
  10. How to Write a Greater Than Symbol in LaTeX?
  11. How to write a norm symbol in LaTeX?
  12. How to write A Plus-Minus Symbol in LaTeX
  13. How to write a proportional to symbol in LaTeX?
  14. How to write a real number symbol in LaTeX?
  15. How to write a tilde symbol in LaTeX?
  16. How to write a union symbol in LaTeX?
  17. How to write a vector in LaTeX?
  18. How to write an infinity symbol in LaTeX?
  19. How to write bold text in LaTeX?
  20. How To Write Dots Symbols In LaTeX?
  21. How to write the arrow symbols in LaTeX
  22. How to write the Degree celsius symbol in LaTeX?
  23. How to write the equal or not equal symbol in LaTeX?
  24. How to write the Euro symbol in LaTeX?
  25. How to write the gradient operator symbol in LaTeX
  26. How To Write The Greater Than Or Equal To Symbol In LaTeX?
  27. How to write the integer number symbol in LaTeX?
  28. How to write the less than symbol in LaTeX?
  29. How to write the Natural numbers symbol in LaTeX?
  30. How to write the parallel symbol in LaTeX?
  31. How to write the percent symbol in LaTeX?
  32. How to write the square root symbol in LaTeX?
  33. How To Write The Symbol For A Subset In LaTeX?
  34. How to write the symbol for therefore in LaTeX?
  35. How to write with the mathbb in LaTeX?

Photo of author
Author
SJ Tsai
Chief Editor. Writer wrangler. Research guru. Three years at scijournal. Hails from a family with five PhDs. When not shaping content, creates art. Peek at the collection on Etsy. For thoughts and updates, hit up Twitter.

Leave a Comment