Administrator
|
You are correct, the binary value 1000 0000 0000 0000 is -32768 in 2's-complement. But the Jack compiler can't handle it because the '-' is actually unary negation and 32768 is not a legal positive integer.
What you can do is 32767+1 or ~32767.
Also note that if you are using
let twoToThe[j+1] = twoToThe[j]+twoToThe[j];
to initialize the array, 16384+16384 will result in -32768.
--Mark
|