Xbase++ internally store numeric values in one of these formats 32 bit signed integer (LONG) and 64 bit floating point (double). Xbase++ will store values with a decimal component always as a double and will try to store integer values as a LONG if possible, and if the value not fit inside a LONG will store it also as a double.
This is the representation in memory of the double floating point

Windows use also 32 bit floating point values, using 23 bits to store the mantissa and 8 bits to store the exponent. We will not enter now in more detail about floating point numbers, we just need to know that the storage of floating point numbers is totally different than the integer numbers, and unlike integer values a single portion of a floating point number is totally useless by itself.
The next graphic contain the representation of the INTEGER types used by Windows

As you can see in the graphic, bytes are sorted with the less significant byte ( LSB) at the left side and the most significant byte (MSB), this form of store integers is called Little Endian.
Integers of the same size can have 2 possible interpretations signed and unsigned, for this reason we need to take care when we need to interpret values provided from the Windows API.
When we retrieve a 8 or 16 bit unsigned integer value from the API we must take care that the right part of the value don't contain garbage so we need to use the ot4xb functions Unsigned8() and Unsigned16() to ensure the right part will only contain zeros.
With 8 and 16 bit signed values we need to fill the right bits with zeros if the number is positive or with ones if the numbers is negative. For this cases ot4xb provide functions ExtendSign8() and ExtendSign16() that will fill the bits on the right part with 0 or 1 depending if the number is positive or negative.
Xbase++ can interpret correctly 32 bit signed integers without the need of any previous transformation. 32 bit unsigned values lower than 0x80000000 (2147483648) also not need any transformation to be correctly interpreted.
With 32 bit unsigned values higher than 0x7FFFFFFF (2147483647) we have a little trouble, because Xbase++ cannot interpret them as integer positive values so we need to convert it to double. The trouble is that not all 32 bit integers have an exact floating point storage, so after the conversion we may have an approximate value, this sometimes can be a because that a numeric compare between apparently same values can fail if a small decimal portion of the number differ, the workaround in this cases is use Round() to compare them. The ot4xb function Long2Double() will convert a 32bit unsigned value to double if not possible to represent it as integer.
There are a lot of times where we can retrieve 32 bit unsigned integer values from the Windows API, but we not need to show it or make arithmetic calculations with it. When the number is used as a handle or we just need to pass it again to another API function, or the bits of the integer are used to store flags inside; in these cases is preferable don't transform it.
Ot4xb manage signed and unsigned 64 bit integers as a 8 byte character string, also provides ULARGE_INTEGER() and LARGE_INTEGER() classes to perform operations between 64 bit integers or represent them properly as a character numeric string.