Latex Math Mode – Rounding to Nearest Integer Symbol in Latex

math-modemath-operators

There are some threads here, in which it is explained how to use \lceil \rceil \lfloor \rfloor.

But generally, in math, there is a sign that looks like a combination of ceil and floor, which means round, aka nearest integer.

Is there a way to draw this sign in Latex's math mode?

Best Answer

The mathtools package has a \DeclarePairedDelimiter command which lets you define such macros. I defined a \nint command which encloses its argument between \lfloor and \rceil. The starred version adds a pair of implicit \left...\right, but you may fine-tune the delimiters size using one of \big, \Big, \bigg, \Biggas an optional argument.

\documentclass[10pt,a4paper]{article}
\usepackage{mathtools, nccmath}

\DeclarePairedDelimiter{\nint}\lfloor\rceil

\DeclarePairedDelimiter{\abs}\lvert\rvert

\begin{document}

    \[ \nint{x}\qquad \nint*{\sqrt{x^2 + \mfrac13}}\qquad\nint[\Big]{\sqrt{x^2}} = \abs{x}\]%

\end{document} 

enter image description here

Related Question