# Full series expansion of the floor function

We know if $x$ is not an integer we have

$$\left \lfloor x \right \rfloor=x-\frac{1}{2}+\frac{1}{\pi }\sum_{k=1}^{\infty}\frac{\sin(2\pi kx)}{k}$$

Is there an series expansion of floor function which contains the situation of $x$ being an integer?

-
If $x=1$, then $\lfloor 1\rfloor=1$ and $\sin(2\pi k)=0,\ \forall k$, but your formula makes $\lfloor 1\rfloor$=1/2. Could you explain how you obtained this result? –  7raiden7 Apr 22 '14 at 14:13
From wikipedia... It only works on noninteger real numbers... –  esege Apr 22 '14 at 14:13
Just a joke ... $$\left \lfloor x \right \rfloor = x-\frac \pi 4 \mathrm{sgn}(\sin(x)) + \sum_{n=1}^\infty \frac{\sin((2n+1)x)}{2n+1}$$ –  Santosh Linkha Apr 22 '14 at 14:16
here's my joke answer: let $$f(x)=x-\frac{1}{2}+\frac{1}{\pi }\sum_{k=1}^{\infty}\frac{\sin(2\pi kx)}{k}$$then let $$g(x)=\lim_{x\to 0^+} f(x+h)-h$$ –  Snowbody Jun 4 '14 at 19:55