very simple question, I read that GCC supports long long int type. But how can make math operations with it, when CPU is 32 bit wide only?
Internally, the type is represented by a high-word and a low-word, like:
struct long
{
int32 highWord;
uint32_t lowWord;
}
The compiler needs to know if it is a 32bit or 64bit environment and then selects the right reprenstations of the number - if it is 64bit, it can be done natively, if it is 32bit, the compiler has to take care of the math between the high/lowword.
If you have a look in math.h, you can see the functions used for this, and use them yourself. On an additional note, be aware of the difference between little-endian and big-endian (see wiki), the usage depends on the operating system.