"Integer average" of two integer numbers Suppose two arbitrary integer numbers $a$ and $b$. I'm looking for some function $f(a,b)$ with the following properties:


*

*$f(a,b)\in\mathbb{Z}$.

*$f(a,a)=a$.

*$f(a,b)=f(b,a)$.

*$\min\{a,b\}< f(a,b)< \max\{a,b\}$, accepting "$\leq$" if $a$ and $b$ are consecutive ($a=b\pm 1$).


Any example of such a function? 
Improvement: Any solution avoiding "floor/ceiling-like" functions?

$$f(a,b)=\frac{a+b-\sin^2\left(\pi(a+b)/2\right)}{2}$$
Yes, it's just the floor function in disguise :-)
