Solved by tuxa in post #4 
              
              
                int16 can only store values from -32768 to 32767 (2^15 bits + one for the sign). 35358 overflows the upper limit and the result gets negative.