I assume this means you have a 16-bit value stored in a Blitz 32-bit integer, with the high 16 bits all being zero.
Blitz will see this as unsigned: 0 to 65535.
To convert to signed you leave 0 to 32767 unchanged.
For values greater than 32767 you must subtract 65536.
Example: n% = %111111111111111 ( sixteen ones ).
This is 65535 unsigned, but is 65535-65536 = -1 signed.
Blitz will see this as unsigned: 0 to 65535.
To convert to signed you leave 0 to 32767 unchanged.
For values greater than 32767 you must subtract 65536.
Example: n% = %111111111111111 ( sixteen ones ).
This is 65535 unsigned, but is 65535-65536 = -1 signed.