@GullyFourmyle: You are correct, it appears a 32bit unsigned integer is being used for the Units we can have. At some point HG capped the max amount, to prevent a roll-over, back to 0.
However, as a previous discussion (NEXT) shows, not always is an unsigned 32bit integer being used. The Trade Terminal appeared to be using a ‘signed’ integer instead. Would be interesting to know if this has changed.
See: Large Integers and Currency
@zsigmond:
In short, considering C/C++ to be used, the amount of bits used, completely depends on the compiler. The compiler is however capable of making this ‘any’ size it wants, as long as it meets the minimum requirements. You can specify, implement and compile it to your needs, as it is scalable with some rules in place.
You could for example use 47 bit, with 17 bit ‘padding’, resulting in 64 bit memory being used. You could also use 109 bit with 19 bit padding to fit 128 bit.
In practise however, it is all about efficiency, which takes the hardware into account to achieve maximum performance. For this reason it is ‘currently’ most common to use a basic type of 32 bit.