if ((nr & bit(15)) == bit(15))
You must write the numbers in their binary (bit) format and do a bit-and as AWOL explained
nr 1000 0000 1111 1111
bit(15) 1000 0000 0000 0000
& ---------------------
1000 0000 0000 0000
the result is bit(15) again that is why it is compared to bit(15). If it was not equal the sign bit wasn't set so zero or positive number.