Short INT / Unsigned Short INT

Blitz3D Forums/Blitz3D Beginners Area/Short INT / Unsigned Short INT

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

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.