<s>[INST] Value of $\left \lfloor{x}\right \rfloor+\left \lfloor{-x}\right \rfloor$? 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.
 [/INST] $T=\left\lfloor x \right\rfloor  + \left\lfloor { - x} \right\rfloor $
When x=n, only integer
$\underbrace {\left\lfloor x \right\rfloor }_n + \underbrace {\left\lfloor { - x} \right\rfloor }_{ - n} \Rightarrow n - n = 0$
When x=n+a, $a\in(0,1)$
$\left\lfloor {n + a} \right\rfloor  + \left\lfloor { - n - 1 + 1 - a} \right\rfloor $
$a \in \left( {0,1} \right)$, therefore $a' = 1 - a \in \left( {0,1} \right)$
$\underbrace {\left\lfloor {n + a} \right\rfloor }_n + \underbrace {\left\lfloor { - n - 1 + a'} \right\rfloor }_{ - n - 1} = n - n - 1 =  - 1$.
Hence when x is an integer $T=0$, else $T=-1$
</s>