{\displaystyle q={\begin{cases}y-0.5,&{\mbox{if }}y-2\left\lfloor y/2\right\rfloor =0.5\\\left\lfloor y+0.5\right\rfloor ,&{\mbox{if }}y-2\left\lfloor y/2\right\rfloor \not =0.5\end{cases}}}