Rounding to nearest integer symbol in Latex
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
, \Bigg
as 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}