While reading about greatest integer function from a book, I found a question as $\left \lfloor{x}\right \rfloor+\left \lfloor{-x}\right \rfloor$ ?
I attempted it as follows:
We know:
$x-1<\left \lfloor{x}\right \rfloor< x\tag1$
Also then: $-x-1 < \left \lfloor{-x}\right \rfloor < -x\tag2$
Adding $(1)$ & $(2)$, we get
$-2< \left \lfloor{x}\right \rfloor+\left \lfloor{-x}\right \rfloor<0$.
This is the answer which I got, but the actual answer was $\left \lfloor{x}\right \rfloor+\left \lfloor{-x}\right \rfloor= -1$. I am not getting this. Where my method has gone wrong? Please help me.