Is there a macro in latex to write `ceil(x)`

and `floor(x)`

in short form? The long form

```
\left \lceil{x}\right \rceil
```

is a bit lengthy to type every time it is used.

Skip to content
# [Tex/LaTex] How to write ceil and floor in latex?

math-mode

Is there a macro in latex to write `ceil(x)`

and `floor(x)`

in short form? The long form

```
\left \lceil{x}\right \rceil
```

is a bit lengthy to type every time it is used.

## Best Answer

Using

`\DeclarePairedDelimiter`

from`mathtools`

, you could define macros`\ceil`

and`\floor`

, which will scale the delimiters properly (if starred):Result: