[Gambas-user] unsigned int datatype for external function

Jussi Lahtinen jussi.lahtinen at gmail.com
Sun Jun 10 20:10:29 CEST 2018


>
> That means that the Gambas integer type is only 31 (+ 1) bits wide. Not
> wide enough to hold a 32-bit unsigned integer if the
> highest bit is reserved for the sign bit.
>
> So then, if it is wide enough as you say, how would one manage a 32-bit
> unsigned integer in a 32-bit signed datatype?
>

They both contain 32bits of information, unsigned or not. Signed integer
only means that the most significant bit is reserved for the sign.
When the library reads the signed value, it ignores the original meaning of
the most significant bit, because it assumes it as unsigned.


Jussi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180610/a33c4072/attachment-0001.html>


More information about the User mailing list