Is the type "long long" always 64 bits?

I'm trying to implement an algorithm with the optional Multiply-With-Carry algorithm from George Marsaglia in C. It seems to work fine under Win7 64-bit and Linux 32-bit, but it seems to behave strangely under Win 7 32-bit. The random number it returns is 32 bits, but it uses an internal temporary value, which should be 64 bits, and it declared:

unsigned long long t;

I suspect this may be causing the wrong behavior, so my question is:

Is the type "long long" 64 bits? Is it supported on 32-bit Windows?

+3
source share
2 answers

long long 64 ( , ).

5.2.2.2.2 C99 ( ):

- unsigned long long int

ULLONG_MAX 18446744073709551615 // 2**64 − 1

+5

stdint.h, uint64_t.

+7

Source: https://habr.com/ru/post/1730123/


All Articles