[Math] How to express “round up to the nearest 2” in mathematical notation

notation

I'm trying to solve a problem I posted here on Math SE. Part of my solution is to round up to the nearest x (e.g. 4.5 rounds up to 6 if x = 2). How do I express that in mathematical notation?

Best Answer

Typically, we round to integers, and so we have good notation for doing so. For example:

  1. $\lfloor x \rfloor$ rounds $x$ down to an integer,
  2. $\lceil x \rceil$ rounds $x$ up to an integer, and
  3. $\lceil x \rfloor$ rounds $x$ to the nearest integer (with the borderline case $\ast.5$ rounding up or down according to some rule).

To round to a multiple of some given number, we can first divide by that number, round to an integer, then multiply by that number. Thus if we want to round $x$ up to the nearest multiple of $m$, we can write $$ m \left\lceil \frac{x}{m} \right\rceil.$$ To round down, or to round to the nearest multiple of $m$, replace $\lceil \cdot \rceil$ with the appropriate operation.